summaryrefslogtreecommitdiff
path: root/lib/rubygems/config_file.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-18 08:37:18 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-18 08:37:18 +0000
commitec6c07570237b209d47b7690a5b5a6774301242b (patch)
tree70902f2e19499bb3bd26f014aa12bb43b96e9b22 /lib/rubygems/config_file.rb
parent3367daf716bda6e73f3418dd601bd1713d557c07 (diff)
downloadruby-ec6c07570237b209d47b7690a5b5a6774301242b.tar.gz
Merge upstream revision of rubygems/rubygems.
This commits includes tiny bugfix and new features listed here: * Add --re-sign flag to cert command by bronzdoc: https://github.com/rubygems/rubygems/pull/2391 * Download gems with threads. by indirect: https://github.com/rubygems/rubygems/pull/1898 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/config_file.rb')
-rw-r--r--lib/rubygems/config_file.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index c0fe3d8964..9ef1236204 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -27,6 +27,7 @@ require 'rbconfig'
# +:backtrace+:: See #backtrace
# +:sources+:: Sets Gem::sources
# +:verbose+:: See #verbose
+# +:concurrent_downloads+:: See #concurrent_downloads
#
# gemrc files may exist in various locations and are read and merged in
# the following order:
@@ -43,6 +44,7 @@ class Gem::ConfigFile
DEFAULT_BULK_THRESHOLD = 1000
DEFAULT_VERBOSITY = true
DEFAULT_UPDATE_SOURCES = true
+ DEFAULT_CONCURRENT_DOWNLOADS = 8
##
# For Ruby packagers to set configuration defaults. Set in
@@ -105,6 +107,11 @@ class Gem::ConfigFile
attr_accessor :verbose
##
+ # Number of gem downloads that should be performed concurrently.
+
+ attr_accessor :concurrent_downloads
+
+ ##
# True if we want to update the SourceInfoCache every time, false otherwise
attr_accessor :update_sources
@@ -177,6 +184,7 @@ class Gem::ConfigFile
@bulk_threshold = DEFAULT_BULK_THRESHOLD
@verbose = DEFAULT_VERBOSITY
@update_sources = DEFAULT_UPDATE_SOURCES
+ @concurrent_downloads = DEFAULT_CONCURRENT_DOWNLOADS
operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS)
platform_config = Marshal.load Marshal.dump(PLATFORM_DEFAULTS)
@@ -200,6 +208,7 @@ class Gem::ConfigFile
@path = @hash[:gempath] if @hash.key? :gempath
@update_sources = @hash[:update_sources] if @hash.key? :update_sources
@verbose = @hash[:verbose] if @hash.key? :verbose
+ @concurrent_downloads = @hash[:concurrent_downloads] if @hash.key? :concurrent_downloads
@disable_default_gem_server = @hash[:disable_default_gem_server] if @hash.key? :disable_default_gem_server
@sources = @hash[:sources] if @hash.key? :sources
@@ -415,6 +424,9 @@ if you believe they were disclosed to a third party.
yaml_hash[:update_sources] = @hash.fetch(:update_sources, DEFAULT_UPDATE_SOURCES)
yaml_hash[:verbose] = @hash.fetch(:verbose, DEFAULT_VERBOSITY)
+ yaml_hash[:concurrent_downloads] =
+ @hash.fetch(:concurrent_downloads, DEFAULT_CONCURRENT_DOWNLOADS)
+
yaml_hash[:ssl_verify_mode] =
@hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode