diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-21 10:20:47 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-21 10:20:47 +0000 |
commit | 5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch) | |
tree | c63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/config_file.rb | |
parent | 2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff) | |
download | ruby-5335ce0e060c7a2a0b01c57f8f8a64254f2658e1.tar.gz |
Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop
https://github.com/rubygems/rubygems/pull/2478
* Enable Style/MultilineIfThen in Rubocop
https://github.com/rubygems/rubygems/pull/2479
* Fix required_ruby_version with prereleases and improve error message
https://github.com/rubygems/rubygems/pull/2344
* Fix bundler rubygems binstub not properly looking for bundler
https://github.com/rubygems/rubygems/pull/2426
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/config_file.rb')
-rw-r--r-- | lib/rubygems/config_file.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index f8782015a1..e02655fc51 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -174,12 +174,12 @@ class Gem::ConfigFile arg_list = [] args.each do |arg| - if need_config_file_name then + if need_config_file_name @config_file_name = arg need_config_file_name = false - elsif arg =~ /^--config-file=(.*)/ then + elsif arg =~ /^--config-file=(.*)/ @config_file_name = $1 - elsif arg =~ /^--config-file$/ then + elsif arg =~ /^--config-file$/ need_config_file_name = true else arg_list << arg @@ -281,13 +281,13 @@ if you believe they were disclosed to a third party. def load_api_keys check_credentials_permissions - @api_keys = if File.exist? credentials_path then + @api_keys = if File.exist? credentials_path load_file(credentials_path) else @hash end - if @api_keys.key? :rubygems_api_key then + if @api_keys.key? :rubygems_api_key @rubygems_api_key = @api_keys[:rubygems_api_key] @api_keys[:rubygems] = @api_keys.delete :rubygems_api_key unless @api_keys.key? :rubygems @@ -306,7 +306,7 @@ 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 + def rubygems_api_key=(api_key) set_api_key :rubygems_api_key, api_key @rubygems_api_key = api_key @@ -315,7 +315,7 @@ if you believe they were disclosed to a third party. ## # Set a specific host's API key to +api_key+ - def set_api_key host, api_key + def set_api_key(host, api_key) check_credentials_permissions config = load_file(credentials_path).merge(host => api_key) |