From cf2b6d4e80aad8259d071d81a292adfe6e669923 Mon Sep 17 00:00:00 2001 From: John Mair Date: Wed, 8 Jun 2011 01:00:06 +1200 Subject: [PATCH] removed specs.map.with_index from gem-list command and replaced with each_with_index.map to meet 1.8 compatibility --- lib/pry/default_commands/gems.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pry/default_commands/gems.rb b/lib/pry/default_commands/gems.rb index 3f2d4421..e846251f 100644 --- a/lib/pry/default_commands/gems.rb +++ b/lib/pry/default_commands/gems.rb @@ -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 ', '})"