Sha256: 1722c1a9a858bf243354aa34bf43e7b4407f59efd9556609505842c4bb222913

Contents?: true

Size: 785 Bytes

Versions: 30

Compression:

Stored size: 785 Bytes

Contents

require 'rubygems/command'
require 'rubygems/local_remote_options'
require 'rubygems/spec_fetcher'
require 'rubygems/version_option'

class Gem::Commands::OutdatedCommand < Gem::Command

  include Gem::LocalRemoteOptions
  include Gem::VersionOption

  def initialize
    super 'outdated', 'Display all gems that need updates'

    add_local_remote_options
    add_platform_option
  end

  def execute
    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

      next if remotes.empty?

      remote = remotes.last.first
      say "#{local.name} (#{local.version} < #{remote.version})"
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rubygems-update-1.8.30 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.29 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.28 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.23.2 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.27 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.26 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.25 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.24 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.23 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.22 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.21 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.20 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.19 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.18 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.17 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.16 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.15 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.14 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.13 lib/rubygems/commands/outdated_command.rb
rubygems-update-1.8.12 lib/rubygems/commands/outdated_command.rb