aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/config_file.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-04 00:29:40 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-04 00:29:40 +0000
commit5a90f9e8f84533e7859232895fc4bbe6b31cc771 (patch)
treee15086587f691a1f5bd3c7ddbfa38e825828caf6 /lib/rubygems/config_file.rb
parentf1321bd6e7c2d6b6a29a67074bad6f2742263921 (diff)
downloadruby-5a90f9e8f84533e7859232895fc4bbe6b31cc771.tar.gz
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.6.1.
Please see entries of 2.6.0 and 2.6.1 on https://github.com/rubygems/rubygems/blob/master/History.txt [fix GH-1270] Patch by @segiddins git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/config_file.rb')
-rw-r--r--lib/rubygems/config_file.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index de90cbfd65..c8014814b4 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -306,9 +306,18 @@ if you believe they were disclosed to a third party.
# Sets the RubyGems.org API key to +api_key+
def rubygems_api_key= api_key
+ set_api_key :rubygems_api_key, api_key
+
+ @rubygems_api_key = api_key
+ end
+
+ ##
+ # Set a specific host's API key to +api_key+
+
+ def set_api_key host, api_key
check_credentials_permissions
- config = load_file(credentials_path).merge(:rubygems_api_key => api_key)
+ config = load_file(credentials_path).merge(host => api_key)
dirname = File.dirname credentials_path
Dir.mkdir(dirname) unless File.exist? dirname
@@ -320,7 +329,7 @@ if you believe they were disclosed to a third party.
f.write config.to_yaml
end
- @rubygems_api_key = api_key
+ load_api_keys # reload
end
def load_file(filename)