| 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: locals = Gem::SourceIndex.from_installed_gems
20:
21: locals.outdated.sort.each do |name|
22: local = locals.find_name(name).last
23:
24: dep = Gem::Dependency.new local.name, ">= #{local.version}"
25: remotes = Gem::SpecFetcher.fetcher.fetch dep
26: remote = remotes.last.first
27:
28: say "#{local.name} (#{local.version} < #{remote.version})"
29: end
30: end