method

update_gem

update_gem(name, version = Gem::Requirement.default)
public

No documentation available.

# File lib/rubygems/commands/update_command.rb, line 201
  def update_gem name, version = Gem::Requirement.default
    return if @updated.any? { |spec| spec.name == name }

    update_options = options.dup
    update_options[:prerelease] = version.prerelease?

    @installer = Gem::DependencyInstaller.new update_options

    say "Updating #{name}"
    begin
      @installer.install name, Gem::Requirement.new(version)
    rescue Gem::InstallError, Gem::DependencyError => e
      alert_error "Error installing #{name}:\n\t#{e.message}"
    end

    @installer.installed_gems.each do |spec|
      @updated << spec
    end
  end