mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems HEAD(c202db2).
this version contains many enhancements see http://git.io/vtNwF * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9c4ef4b191
commit
effdbf5936
90 changed files with 2489 additions and 1159 deletions
|
@ -61,18 +61,22 @@ class Gem::Request::ConnectionPools # :nodoc:
|
|||
end
|
||||
|
||||
def net_http_args uri, proxy_uri
|
||||
net_http_args = [uri.host, uri.port]
|
||||
# URI::Generic#hostname was added in ruby 1.9.3, use it if exists, otherwise
|
||||
# don't support IPv6 literals and use host.
|
||||
hostname = uri.respond_to?(:hostname) ? uri.hostname : uri.host
|
||||
net_http_args = [hostname, uri.port]
|
||||
|
||||
no_proxy = get_no_proxy_from_env
|
||||
|
||||
if proxy_uri and not no_proxy?(uri.host, no_proxy) then
|
||||
if proxy_uri and not no_proxy?(hostname, no_proxy) then
|
||||
proxy_hostname = proxy_uri.respond_to?(:hostname) ? proxy_uri.hostname : proxy_uri.host
|
||||
net_http_args + [
|
||||
proxy_uri.host,
|
||||
proxy_hostname,
|
||||
proxy_uri.port,
|
||||
Gem::UriFormatter.new(proxy_uri.user).unescape,
|
||||
Gem::UriFormatter.new(proxy_uri.password).unescape,
|
||||
]
|
||||
elsif no_proxy? uri.host, no_proxy then
|
||||
elsif no_proxy? hostname, no_proxy then
|
||||
net_http_args + [nil, nil]
|
||||
else
|
||||
net_http_args
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue