зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Allow to use String keys some of configuration
https://github.com/rubygems/rubygems/commit/ee0bef2786
This commit is contained in:
Родитель
0be7133b7f
Коммит
0930231361
|
@ -210,6 +210,17 @@ class Gem::ConfigFile
|
|||
@hash = @hash.merge environment_config
|
||||
end
|
||||
|
||||
@hash.transform_keys! do |k|
|
||||
# gemhome and gempath are not working with symbol keys
|
||||
if %w[backtrace bulk_threshold verbose update_sources cert_expiration_length_days
|
||||
install_extension_in_lib ipv4_fallback_enabled sources disable_default_gem_server
|
||||
ssl_verify_mode ssl_ca_cert ssl_client_cert].include?(k)
|
||||
k.to_sym
|
||||
else
|
||||
k
|
||||
end
|
||||
end
|
||||
|
||||
# HACK: these override command-line args, which is bad
|
||||
@backtrace = @hash[:backtrace] if @hash.key? :backtrace
|
||||
@bulk_threshold = @hash[:bulk_threshold] if @hash.key? :bulk_threshold
|
||||
|
|
|
@ -487,6 +487,16 @@ if you believe they were disclosed to a third party.
|
|||
end
|
||||
end
|
||||
|
||||
def test_accept_string_key
|
||||
File.open @temp_conf, "w" do |fp|
|
||||
fp.puts "verbose: false"
|
||||
end
|
||||
|
||||
util_config_file
|
||||
|
||||
assert_equal false, @cfg.verbose
|
||||
end
|
||||
|
||||
def test_load_ssl_verify_mode_from_config
|
||||
File.open @temp_conf, "w" do |fp|
|
||||
fp.puts ":ssl_verify_mode: 1"
|
||||
|
|
Загрузка…
Ссылка в новой задаче