Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/rubygems/config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ def initialize(args)
@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 global_gem_cache sources
concurrent_downloads install_extension_in_lib ipv4_fallback_enabled
global_gem_cache sources
disable_default_gem_server ssl_verify_mode ssl_ca_cert ssl_client_cert].include?(k)
k.to_sym
else
Expand All @@ -233,7 +234,7 @@ def initialize(args)
@bulk_threshold = @hash[:bulk_threshold] if @hash.key? :bulk_threshold
@verbose = @hash[:verbose] if @hash.key? :verbose
@update_sources = @hash[:update_sources] if @hash.key? :update_sources
# TODO: We should handle concurrent_downloads same as other options
@concurrent_downloads = @hash[:concurrent_downloads] if @hash.key? :concurrent_downloads
@cert_expiration_length_days = @hash[:cert_expiration_length_days] if @hash.key? :cert_expiration_length_days
@install_extension_in_lib = @hash[:install_extension_in_lib] if @hash.key? :install_extension_in_lib
@ipv4_fallback_enabled = @hash[:ipv4_fallback_enabled] if @hash.key? :ipv4_fallback_enabled
Expand Down
10 changes: 10 additions & 0 deletions test/rubygems/test_gem_config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ def test_initialize_global_gem_cache_gemrc
assert_equal true, @cfg.global_gem_cache
end

def test_initialize_concurrent_downloads
File.open @temp_conf, "w" do |fp|
fp.puts "concurrent_downloads: 2"
end

util_config_file %W[--config-file #{@temp_conf}]

assert_equal 2, @cfg.concurrent_downloads
end

def test_initialize_handle_arguments_config_file
util_config_file %W[--config-file #{@temp_conf}]

Expand Down