I'm using Ruby 1.8.7. I have a text file with following content:
"testhost-01.test.de|lan|ip-v4|cmk-agent|tcp|ip-v4-only|site:tir_projects|test|wato|/" + FOLDER_PATH +…
i have an old rails project here running rails 2.3.8 and ruby 1.8.7 with rvm.
when i'm running rake -T or another rake task it will fail with
I18n::UnknownFileType: can not load translations from…
I have a form with some fields in my rails 2 application and I want to prepopulate the value from what was entered before. The parameters values are in the url
here is the code for the form:
<% form_tag({:controller => "articles", :action =>…
I am trying to implement auto_complete functionality in Rails 2.3.x application which is developed in Ruby 1.8.7. My application uses pure javascript and prototypen js. I am unable to use jQuery-UI which has inbuilt auto-complete functionality. I…
I have clone the rubycas-server project and followed the steps as they mentioned in their documentation. When I am doing the bundle install I am getting the following error:
Fetching gem metadata from http://rubygems.org/....Retrying dependency api…
Is there any way to destroy dependencies only after checking condition?
This is my Model subject_type.rb
class SubjectType < ActiveRecord::Base
has_many :subjects, :dependent=>:destroy
validates_presence_of :name
end
If subject_type_id is…
I have two arrays, one with information from the old DB and one with information from the new DB. I want to check what is in the old DB that is NOT in the new DB, and delete that.
I have done array1 - array2 and put the results in an array, but…
Inspired from this post, I wanted to generalize the problem.
to check if given number m is integer power of number n.
Here is my first attempt and and as I tested it, everything is ok.
Then I attempted to write something different inspired from a…
While developing spec tests for a Puppet module, TravisCI tests against various Ruby/Gem/Puppet versions. Often all tests work on all versions except with Ruby 1.8.7. There the tests don't even start. Instead you get an error that mentions…
I have e.g. r = "\t" and a = "thisisabigbad\wolf"
How can I prevent ruby from auto escaping my string and also count the \ at the same time?
a.count r #=> this should return 2 instead of 0
I wish to do a.count and receive 2
I have two arrays:
expected = ["a", "b", "c", "d", "e", "f", "g"]
actual = ["a", "b", "c", "d", "d", "g", "g"]
I converted both to string like this:
expected1 = "a,b,c,d,e,f,g"
actual1 = "a,b,c,d,d,g,g"
I will compare each value if they are the…
Currently I have a list of random games in an array.
games=[["Game1", 2014, "Creator1", "Creator2", "Creator3"],
["Game4", 2013, "Creator7", "Creator10"],
["Game2", 2014, "Creator1"],
["Game6", 2012, "Creator9"],
…
How to take more than 1000 records from oracle database using rails 2
@business_users_loc = User.find(:all,:conditions=>"(users.role_id NOT IN ('#{Role[:submember].id}') AND locations.mac_id IS NOT NULL and users.mac_id IS NOT NULL and…
My array is:
[{:age=>28, :name=>"John", :id=>1}, {:name=>"David", :age=>20, :id=>2}]
Order:
[:id, :name, :age] or ['id', 'name', 'age']
The result should be:
[{:id=>1, :name=>"John", :age=>28}, {:id=>2, :name=>"David", :age=>20}]
P/s: I am using…
I have Puppet type defined like this:
Puppet::Type.newtype(:my_type) do
newproperty(:id, :readonly => true) do
desc "Some id."
end
end
I want to ask how to test in rspecs that property :id is readonly?
describe…