Questions tagged [ruby-1.8.7]

For issues relating to developing in Ruby, version 1.8.7.

Use this specific tag along with the generic one: .

203 questions
0
votes
1 answer

How do I make this regular expression more general?

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 +…
mobios
  • 353
  • 1
  • 2
  • 7
0
votes
1 answer

Rails 2.3.8 I18n::UnknownFileType the file type yml is not known

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…
rob
  • 2,136
  • 8
  • 29
  • 37
0
votes
2 answers

prepopulate form with data in rails 2

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 =>…
delpha
  • 931
  • 1
  • 8
  • 23
0
votes
0 answers

Plugin/ Gem to Implement autocomplete functionality in Rails 2.3.x

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…
Ranzit
  • 1,327
  • 2
  • 13
  • 32
0
votes
1 answer

Bundler::MarshalError TypeError: incompatible marshal file format + Ruby CAS Server

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…
Deepti Kakade
  • 3,053
  • 3
  • 19
  • 30
0
votes
0 answers

Rails 2 dependent => destroy should work after condtion

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…
Sanju B Myh
  • 271
  • 1
  • 15
0
votes
1 answer

Crosscheck arrays and delete from DB what is left over

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…
Noahhh
  • 15
  • 6
0
votes
1 answer

ruby function that checks if one of given number is integer power of another one

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…
marmeladze
  • 6,468
  • 3
  • 24
  • 45
0
votes
1 answer

rspec-puppet with ruby 1.8.7 gives "unexpected ')'" error but all other ruby versions work

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…
TomOnTime
  • 4,175
  • 4
  • 36
  • 39
0
votes
1 answer

Ruby - Prevent auto escape characters

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
Charlie
  • 13
  • 2
0
votes
2 answers

How to get index with multiple values but return single result

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…
Julius G
  • 13
  • 5
0
votes
1 answer

Ruby - How to sort through arrays with minimal iterations

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"], …
Charlie
  • 13
  • 2
0
votes
2 answers

How to take more than 1000 records in array using rails 2

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…
user748447
  • 101
  • 1
  • 8
0
votes
2 answers

Ruby on Rails - How to arrange elements of array in particular order

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…
Anh
  • 27
  • 1
  • 6
0
votes
1 answer

How to test readonly property of Puppet type

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…
kendriu
  • 565
  • 3
  • 21