instance method
Gem::Commands::UpdateCommand#update_gem
update_gem(name, version = Gem::Requirement.default)
lib/rubygems/commands/update_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/commands/update_command.rb, line 238
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}" unless options[:system]
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
No documentation available
See also
#rubygems_target_version
#update_gems
#preparing_gem_layout_for
#update_rubygems
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0