pcorliss / ruby_route_53

Ruby gem and command line tool for Amazon's Route 53 service.
blog.50projects.com
GNU General Public License v3.0
172 stars 32 forks source link

gen_change_xml : String#each has been removed in ruby > 1.9 #37

Closed lukaszraczylo closed 10 years ago

lukaszraczylo commented 10 years ago

They suggest using String#each_line from now on.

pcorliss commented 10 years ago

I'm not seeing an instance of a string object being iterated on with each. Which line are you referring to?

lukaszraczylo commented 10 years ago

Problem occurred while using

v+

record_handler = Route53::DNSRecord.new(*zone_partial)

v-

where zone_partial is an array of strings, taken ( and converted to_s ) from

v+

single_zone.get_records.each do |single_record|

v-

it happens with ruby-1.9.3-p448 ( rvm ) but works just fine with 1.8. Error points to gen_change_xml and I’m afraid there’s some funny thing going on there as only occurrence of .each is line 43.

pcorliss commented 10 years ago

I think the trouble you're running into is that the values argument is expected to be an array and not a string. It probably only works in ruby 1.8 as an accident rather than intentionally.

Happy to help with your integration code if you give me more info. I might be able to suggest a change.

2.0.0-p353 :009 > single_zone.get_records.first.values
 => ["my-load-balancer-498104842.us-east-1.elb.amazonaws.com."] 
2.0.0-p353 :010 > single_zone.get_records.first.values.class
 => Array 
pcorliss commented 10 years ago

Closing due to inactivity.