method

update_gem

Importance_0
v2_1_10 - Show latest stable - 0 notes - Class: UpdateCommand
update_gem(name, version = Gem::Requirement.default) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

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

    @installer ||= Gem::DependencyInstaller.new options

    success = false

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

    @installer.installed_gems.each do |spec|
      @updated << spec
    end
  end
Register or log in to add new notes.