mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 49014:
* tool/downloader.rb: support old versions of ruby. * tool/downloader.rb: now can download gems by http if openssl is not available (this may be danger!) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@51635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
968edaaeb2
commit
a627fdfaaf
3 changed files with 41 additions and 2 deletions
|
|
@ -1,3 +1,10 @@
|
|||
Tue Aug 18 22:52:50 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* tool/downloader.rb: support old versions of ruby.
|
||||
|
||||
* tool/downloader.rb: now can download gems by http if openssl is not
|
||||
available (this may be danger!)
|
||||
|
||||
Tue Aug 18 20:10:13 2015 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* numeric.c (Init_Numeric): Fix document for Float::MIN and
|
||||
|
|
|
|||
|
|
@ -1,4 +1,33 @@
|
|||
require 'open-uri'
|
||||
begin
|
||||
require 'net/https'
|
||||
$rubygems_schema = 'https'
|
||||
|
||||
# open-uri of ruby 2.2.0 accept an array of PEMs as ssl_ca_cert, but old
|
||||
# versions are not. so, patching OpenSSL::X509::Store#add_file instead.
|
||||
class OpenSSL::X509::Store
|
||||
alias orig_add_file add_file
|
||||
def add_file(pems)
|
||||
Array(pems).each do |pem|
|
||||
if File.directory?(pem)
|
||||
add_path pem
|
||||
else
|
||||
orig_add_file pem
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
# since open-uri internally checks ssl_ca_cert by File.directory?, to allow
|
||||
# accept an array.
|
||||
class <<File
|
||||
alias orig_directory? directory?
|
||||
def File.directory? files
|
||||
files.is_a?(Array) ? false : orig_directory?(files)
|
||||
end
|
||||
end
|
||||
rescue LoadError
|
||||
$rubygems_schema = 'http'
|
||||
end
|
||||
|
||||
class Downloader
|
||||
class GNU < self
|
||||
|
|
@ -10,7 +39,10 @@ class Downloader
|
|||
class RubyGems < self
|
||||
def self.download(name, dir = nil, ims = true, options = {})
|
||||
options[:ssl_ca_cert] = Dir.glob(File.expand_path("../lib/rubygems/ssl_certs/*.pem", File.dirname(__FILE__)))
|
||||
super("https://rubygems.org/downloads/#{name}", name, dir, ims, options)
|
||||
if $rubygems_schema != 'https'
|
||||
warn "*** using http instead of https ***"
|
||||
end
|
||||
super("#{$rubygems_schema}://rubygems.org/downloads/#{name}", name, dir, ims, options)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.2.3"
|
||||
#define RUBY_RELEASE_DATE "2015-08-18"
|
||||
#define RUBY_PATCHLEVEL 172
|
||||
#define RUBY_PATCHLEVEL 173
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2015
|
||||
#define RUBY_RELEASE_MONTH 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue