mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Set config_file_name to the value of ENV["GEMRC"] if available
471239f1fa
This commit is contained in:
parent
6f60ead756
commit
7990d8dc50
2 changed files with 8 additions and 2 deletions
|
@ -473,7 +473,7 @@ if you believe they were disclosed to a third party.
|
||||||
|
|
||||||
private
|
private
|
||||||
def set_config_file_name(args)
|
def set_config_file_name(args)
|
||||||
@config_file_name = nil
|
@config_file_name = ENV["GEMRC"] || nil
|
||||||
need_config_file_name = false
|
need_config_file_name = false
|
||||||
|
|
||||||
args.each do |arg|
|
args.each do |arg|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class TestGemConfigFile < Gem::TestCase
|
||||||
Gem::ConfigFile::PLATFORM_DEFAULTS.clear
|
Gem::ConfigFile::PLATFORM_DEFAULTS.clear
|
||||||
|
|
||||||
@env_gemrc = ENV['GEMRC']
|
@env_gemrc = ENV['GEMRC']
|
||||||
ENV['GEMRC'] = ''
|
ENV['GEMRC'] = nil
|
||||||
|
|
||||||
util_config_file
|
util_config_file
|
||||||
end
|
end
|
||||||
|
@ -167,6 +167,12 @@ class TestGemConfigFile < Gem::TestCase
|
||||||
assert_equal 2048, @cfg.bulk_threshold
|
assert_equal 2048, @cfg.bulk_threshold
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_set_config_file_name_from_environment_variable
|
||||||
|
ENV['GEMRC'] = "/tmp/.gemrc"
|
||||||
|
cfg = Gem::ConfigFile.new([])
|
||||||
|
assert_equal cfg.config_file_name, "/tmp/.gemrc"
|
||||||
|
end
|
||||||
|
|
||||||
def test_api_keys
|
def test_api_keys
|
||||||
assert_nil @cfg.instance_variable_get :@api_keys
|
assert_nil @cfg.instance_variable_get :@api_keys
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue