summaryrefslogtreecommitdiff
path: root/tool/downloader.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-23 15:06:40 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-23 15:06:40 +0000
commit7e9175e3d9f55e1f7d363b1b36e8b1fbf1ff0ec6 (patch)
treec467a6120d4f64188fec398da86a028ea958b5f9 /tool/downloader.rb
parente87f45d8a8ee40da9413c19fb4cada7bbcb4a111 (diff)
* lib/open-uri.rb (OpenURI.open_http): accept multiple certs path in
ssl_ca_certs. * tool/downloader.rb: use certs of rubygems for downloading gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/downloader.rb')
-rw-r--r--tool/downloader.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/downloader.rb b/tool/downloader.rb
index c2fc638..67c2752 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