aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands/outdated_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/outdated_command.rb')
-rw-r--r--lib/rubygems/commands/outdated_command.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/rubygems/commands/outdated_command.rb b/lib/rubygems/commands/outdated_command.rb
index ea6b9f0abf..887faab0a2 100644
--- a/lib/rubygems/commands/outdated_command.rb
+++ b/lib/rubygems/commands/outdated_command.rb
@@ -19,12 +19,15 @@ class Gem::Commands::OutdatedCommand < Gem::Command
Gem::Specification.outdated.sort.each do |name|
local = Gem::Specification.find_all_by_name(name).max
dep = Gem::Dependency.new local.name, ">= #{local.version}"
- remotes = Gem::SpecFetcher.fetcher.fetch dep
+ remotes, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dep
next if remotes.empty?
- remote = remotes.last.first
- say "#{local.name} (#{local.version} < #{remote.version})"
+ remotes.sort! { |a,b| a[0].version <=> b[0].version }
+
+ highest = remotes.last.first
+
+ say "#{local.name} (#{local.version} < #{highest.version})"
end
end
end