Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::ConfigFile#remove_api_key_from_file
remove_api_key_from_file(host)
lib/rubygems/config_file.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/config_file.rb, line 833
def remove_api_key_from_file(host)
return unless File.exist?(credentials_path)
unless File.writable?(credentials_path)
alert_warning "The API key moved to the credential store but the plain text copy " \
"in #{credentials_path} could not be removed. Delete it yourself."
return
end
key = self.class.normalize_credentials_key(host)
config = load_file(credentials_path)
return unless config.key?(key)
config.delete(key)
write_credentials(config)
load_api_keys
end
No documentation available