| Class | Gem::Commands::OutdatedCommand |
| In: |
lib/rubygems/commands/outdated_command.rb
|
| Parent: | Gem::Command |
# File lib/rubygems/commands/outdated_command.rb, line 11
11: def initialize
12: super 'outdated', 'Display all gems that need updates'
13:
14: add_local_remote_options
15: add_platform_option
16: end
# File lib/rubygems/commands/outdated_command.rb, line 18
18: def execute
19: Gem::Specification.outdated.sort.each do |name|
20: local = Gem::Specification.find_all_by_name(name).max
21: dep = Gem::Dependency.new local.name, ">= #{local.version}"
22: remotes = Gem::SpecFetcher.fetcher.fetch dep
23:
24: next if remotes.empty?
25:
26: remote = remotes.last.first
27: say "#{local.name} (#{local.version} < #{remote.version})"
28: end
29: end