class Gem::Commands::UpdateCommand

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

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] && options[:silent]
  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