Class Gem::Commands::OutdatedCommand
In: lib/rubygems/commands/outdated_command.rb
Parent: Gem::Command

Methods

execute   new  

Included Modules

Gem::LocalRemoteOptions Gem::VersionOption

Public Class methods

[Source]

    # 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

Public Instance methods

[Source]

    # File lib/rubygems/commands/outdated_command.rb, line 18
18:   def execute
19:     # FIX: this should be able to be Gem.source_index but our test fails :(
20:     locals = Gem::SourceIndex.new Gem::SourceIndex.installed_spec_directories
21: 
22:     locals.outdated.sort.each do |name|
23:       local   = locals.find_name(name).last
24:       dep     = Gem::Dependency.new local.name, ">= #{local.version}"
25:       remotes = Gem::SpecFetcher.fetcher.fetch dep
26: 
27:       next if remotes.empty?
28: 
29:       remote = remotes.last.first
30:       say "#{local.name} (#{local.version} < #{remote.version})"
31:     end
32:   end

[Validate]