diff options
Diffstat (limited to 'tool/downloader.rb')
-rw-r--r-- | tool/downloader.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/downloader.rb b/tool/downloader.rb index c2fc638eae..67c27522dc 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -9,7 +9,7 @@ class Downloader class RubyGems < self def self.download(name, *rest) - super("https://rubygems.org/downloads/#{name}", name, *rest) + super("https://rubygems.org/downloads/#{name}", name, *rest, ssl_ca_cert: Dir.glob(File.expand_path("../lib/rubygems/ssl_certs/*.pem", File.dirname(__FILE__)))) end end @@ -52,7 +52,7 @@ class Downloader # Example usage: # download 'http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt', # 'UnicodeData.txt', 'enc/unicode/data' - def self.download(url, name, dir = nil, ims = true) + def self.download(url, name, dir = nil, ims = true, options = {}) file = dir ? File.join(dir, File.basename(name)) : name if ims.nil? and File.exist?(file) if $VERBOSE @@ -67,7 +67,7 @@ class Downloader $stdout.flush end begin - data = url.read(http_options(file, ims.nil? ? true : ims)) + data = url.read(options.merge(http_options(file, ims.nil? ? true : ims))) rescue OpenURI::HTTPError => http_error if http_error.message =~ /^304 / # 304 Not Modified if $VERBOSE |