class Gem::Commands::FetchCommand

Public Class Methods

new ()
Calls superclass method Gem::Command::new
# File lib/rubygems/commands/fetch_command.rb, line 11
def initialize
  defaults = {
    suggest_alternate: true,
    version: Gem::Requirement.default,
  }

  super "fetch", "Download a gem and place it in the current directory", defaults

  add_bulk_threshold_option
  add_proxy_option
  add_source_option
  add_clear_sources_option

  add_version_option
  add_platform_option
  add_prerelease_option

  add_option "--[no-]suggestions", "Suggest alternates when gems are not found" do |value, options|
    options[:suggest_alternate] = value
  end
end

Public Instance Methods

execute ()
# File lib/rubygems/commands/fetch_command.rb, line 64
def execute
  check_version

  exit_code = fetch_gems

  terminate_interaction exit_code
end