removed specs.map.with_index from gem-list command and replaced with each_with_index.map to meet 1.8 compatibility

This commit is contained in:
John Mair 2011-06-08 01:00:06 +12:00
parent 652dbf4ad4
commit cf2b6d4e80
1 changed files with 5 additions and 5 deletions

View File

@ -33,12 +33,12 @@ class Pry
end
gems.each do |gem, specs|
specs.sort! do |a,b|
Gem::Version.new(b.version) <=> Gem::Version.new(a.version)
specs.sort! do |a,b|
Gem::Version.new(b.version) <=> Gem::Version.new(a.version)
end
versions = specs.map.with_index do |spec, index|
index == 0 ? text.bright_green(spec.version.to_s) : text.green(spec.version.to_s)
versions = specs.each_with_index.map do |spec, index|
index == 0 ? text.bright_green(spec.version.to_s) : text.green(spec.version.to_s)
end
output.puts "#{text.white gem} (#{versions.join ', '})"