method
update_gem
v1_9_3_392 -
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 100
def update_gem name, version = Gem::Requirement.default
return if @updated.any? { |spec| spec.name == name }
success = false
say "Updating #{name}"
begin
@installer.install name, 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
say "Successfully installed #{spec.full_name}" if success
end
end