Skip to content

Commit

Permalink
Merge pull request #1 from ithinkihaveacat/ruby-1.8.x-compat
Browse files Browse the repository at this point in the history
Convert collect_concat() to map().flatten(1) for ruby 1.8 compat.
  • Loading branch information
ximus committed Feb 25, 2012
2 parents adec35e + 8cb355e commit 6e263ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/knife-gandi/plugin_helper.rb
Expand Up @@ -50,7 +50,7 @@ def ip_objects_of(server, opts={})
public_ifaces = public_ifaces.find_all { |iface| iface['type'] == 'public' }
end

public_ips = public_ifaces.collect_concat { |iface| iface['ips'] }
public_ips = public_ifaces.map { |iface| iface['ips'] }.flatten(1)
if opts.has_key?(:version)
# Filter IP version (4|6)
public_ips = public_ips.find_all { |ip| ip['version'] == opts[:version] }
Expand All @@ -60,4 +60,4 @@ def ip_objects_of(server, opts={})
end

end # EOF PluginHelper
end
end

0 comments on commit 6e263ed

Please sign in to comment.