In Files

  • rubygems/commands/outdated_command.rb

Class/Module Index [+]

Quicksearch

Gem::Commands::OutdatedCommand

Public Class Methods

new() click to toggle source
 
               # File rubygems/commands/outdated_command.rb, line 11
def initialize
  super 'outdated', 'Display all gems that need updates'

  add_local_remote_options
  add_platform_option
end
            

Public Instance Methods

execute() click to toggle source
 
               # File rubygems/commands/outdated_command.rb, line 18
def execute
  locals = Gem::SourceIndex.from_installed_gems

  locals.outdated.sort.each do |name|
    local = locals.find_name(name).last

    dep = Gem::Dependency.new local.name, ">= #{local.version}"
    remotes = Gem::SpecFetcher.fetcher.fetch dep
    remote = remotes.last.first

    say "#{local.name} (#{local.version} < #{remote.version})"
  end
end