summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorepitron <chris@ill-logic.com>2013-11-06 01:37:48 -0500
committerepitron <chris@ill-logic.com>2013-11-06 01:37:48 -0500
commit397d89f01aa63413e9b6728bbf768ffefda566c0 (patch)
tree8c82bbe72220edcf2c3d7308c8daeb9f1785fd6b /lib
parente271e17afa644259c7e4250bffe5635f193369bd (diff)
downloadpry-397d89f01aa63413e9b6728bbf768ffefda566c0.tar.gz
Make 'gem-cd' use the most recent gem, not the oldest gem.
Diffstat (limited to 'lib')
-rw-r--r--lib/pry/rubygem.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/rubygem.rb b/lib/pry/rubygem.rb
index f9efb97c..36f788da 100644
--- a/lib/pry/rubygem.rb
+++ b/lib/pry/rubygem.rb
@@ -23,7 +23,7 @@ class Pry
Gem.source_index.find_name(name)
end
- first_spec = specs.sort_by{ |spec| Gem::Version.new(spec.version) }.first
+ first_spec = specs.sort_by{ |spec| Gem::Version.new(spec.version) }.last
first_spec or raise CommandError, "Gem `#{name}` not found"
end