method
update_gem
v2_1_10 -
Show latest stable
- Class:
Gem::Commands::UpdateCommand
update_gem(name, version = Gem::Requirement.default)public
No documentation available.
# 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