summaryrefslogtreecommitdiff
path: root/lib/rubygems/gemcutter_utilities.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-01 11:01:00 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-01 11:01:00 +0000
commit7a46a3b94121339cbead211c4497142bee82fddb ()
treebc6e9f11a1b60f8c4258e4780b18f952b0a8ec35 /lib/rubygems/gemcutter_utilities.rb
parent5cae104e51be9cbf524b7d953b33d0909c46d006 (diff)
Merge rubygems-3.0.0.beta3.
* [GSoC] Multi-factor feature for RubyGems https://.com/rubygems/rubygems/pull/2369 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/rubygems/gemcutter_utilities.rb31
1 files changed, 31 insertions, 0 deletions
@@ -25,6 +25,16 @@ module Gem::GemcutterUtilities
end
##
# The API key from the command options or from the user's configuration.
def api_key
@@ -113,6 +123,13 @@ module Gem::GemcutterUtilities
request.basic_auth email, password
end
with_response response do |resp|
say "Signed in."
set_api_key host, resp.body
@@ -156,6 +173,20 @@ module Gem::GemcutterUtilities
end
end
def set_api_key(host, key)
if host == Gem::DEFAULT_HOST
Gem.configuration.rubygems_api_key = key