bundler 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/bundler.rb +1 -1
- data/lib/bundler/fetcher.rb +30 -33
- data/lib/bundler/ui/shell.rb +2 -5
- data/lib/bundler/vendored_persistent.rb +8 -0
- data/lib/bundler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7fccfcec378505ae78a308e9f840497a8a6593f
|
4
|
+
data.tar.gz: 36f474d0d2bd87d1d4883e7b452dc3b9f44a8e84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7052ec5a2415965569c0a85a1c403b40b37eaa642fc3bb512cd80690505661dc1cf658bfd24100d1146faa28c904e94074e5be64783845b1be139248d449981f
|
7
|
+
data.tar.gz: 6cfc213cafa8e3c381dd52c04b20a6eec60dc6471c4d197694893834ce5cad1d97fec10c723432a352b2393c24d3e29387bfbab2864338c3c62339742c589375
|
data/CHANGELOG.md
CHANGED
data/lib/bundler.rb
CHANGED
data/lib/bundler/fetcher.rb
CHANGED
@@ -91,47 +91,43 @@ module Bundler
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def initialize(remote_uri)
|
94
|
-
|
95
|
-
# How
|
96
|
-
@
|
97
|
-
# How long to wait for each gemcutter API call
|
98
|
-
@api_timeout = 10
|
99
|
-
# How many retries for the gemcutter API call
|
100
|
-
@max_retries = 3
|
94
|
+
@redirect_limit = 5 # How many redirects to allow in one request
|
95
|
+
@api_timeout = 10 # How long to wait for each API call
|
96
|
+
@max_retries = 3 # How many retries for the API call
|
101
97
|
|
102
98
|
@remote_uri = Bundler::Source.mirror_for(remote_uri)
|
103
99
|
@public_uri = @remote_uri.dup
|
104
100
|
@public_uri.user, @public_uri.password = nil, nil # don't print these
|
105
101
|
|
106
102
|
Socket.do_not_reverse_lookup = true
|
103
|
+
connection # create persistent connection
|
107
104
|
end
|
108
105
|
|
109
106
|
def connection
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
107
|
+
@connection ||= begin
|
108
|
+
needs_ssl = @remote_uri.scheme == "https" ||
|
109
|
+
Bundler.settings[:ssl_verify_mode] ||
|
110
|
+
Bundler.settings[:ssl_client_cert]
|
111
|
+
raise SSLError if needs_ssl && !defined?(OpenSSL::SSL)
|
112
|
+
|
113
|
+
con = Net::HTTP::Persistent.new 'bundler', :ENV
|
114
|
+
|
115
|
+
if @remote_uri.scheme == "https"
|
116
|
+
con.verify_mode = (Bundler.settings[:ssl_verify_mode] ||
|
117
|
+
OpenSSL::SSL::VERIFY_PEER)
|
118
|
+
con.cert_store = bundler_cert_store
|
119
|
+
end
|
118
120
|
|
119
|
-
|
120
|
-
|
121
|
-
OpenSSL::
|
122
|
-
|
123
|
-
|
121
|
+
if Bundler.settings[:ssl_client_cert]
|
122
|
+
pem = File.read(Bundler.settings[:ssl_client_cert])
|
123
|
+
con.cert = OpenSSL::X509::Certificate.new(pem)
|
124
|
+
con.key = OpenSSL::PKey::RSA.new(pem)
|
125
|
+
end
|
124
126
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
@connection.key = OpenSSL::PKey::RSA.new(pem)
|
127
|
+
con.read_timeout = @api_timeout
|
128
|
+
con.override_headers["User-Agent"] = self.class.user_agent
|
129
|
+
con
|
129
130
|
end
|
130
|
-
|
131
|
-
@connection.read_timeout = @api_timeout
|
132
|
-
@connection.override_headers["User-Agent"] = self.class.user_agent
|
133
|
-
|
134
|
-
@connection
|
135
131
|
end
|
136
132
|
|
137
133
|
def uri
|
@@ -255,9 +251,10 @@ module Bundler
|
|
255
251
|
raise HTTPError, "Too many redirects" if counter >= @redirect_limit
|
256
252
|
|
257
253
|
response = request(uri)
|
254
|
+
Bundler.ui.debug("HTTP #{response.code} #{response.message}")
|
255
|
+
|
258
256
|
case response
|
259
257
|
when Net::HTTPRedirection
|
260
|
-
Bundler.ui.debug("HTTP Redirection")
|
261
258
|
new_uri = URI.parse(response["location"])
|
262
259
|
if new_uri.host == uri.host
|
263
260
|
new_uri.user = uri.user
|
@@ -265,7 +262,6 @@ module Bundler
|
|
265
262
|
end
|
266
263
|
fetch(new_uri, counter + 1)
|
267
264
|
when Net::HTTPSuccess
|
268
|
-
Bundler.ui.debug("HTTP Success")
|
269
265
|
response.body
|
270
266
|
when Net::HTTPRequestEntityTooLarge
|
271
267
|
raise FallbackError, response.body
|
@@ -275,7 +271,7 @@ module Bundler
|
|
275
271
|
end
|
276
272
|
|
277
273
|
def request(uri)
|
278
|
-
Bundler.ui.debug "
|
274
|
+
Bundler.ui.debug "HTTP GET #{uri}"
|
279
275
|
req = Net::HTTP::Get.new uri.request_uri
|
280
276
|
if uri.user
|
281
277
|
user = CGI.unescape(uri.user)
|
@@ -287,7 +283,8 @@ module Bundler
|
|
287
283
|
retry_with_auth { request(uri) }
|
288
284
|
rescue OpenSSL::SSL::SSLError
|
289
285
|
raise CertificateFailureError.new(uri)
|
290
|
-
rescue *HTTP_ERRORS
|
286
|
+
rescue *HTTP_ERRORS => e
|
287
|
+
Bundler.ui.trace e
|
291
288
|
raise HTTPError, "Network error while fetching #{uri}"
|
292
289
|
end
|
293
290
|
|
data/lib/bundler/ui/shell.rb
CHANGED
@@ -56,12 +56,9 @@ module Bundler
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def trace(e, newline = nil)
|
59
|
+
return unless debug?
|
59
60
|
msg = ["#{e.class}: #{e.message}", *e.backtrace].join("\n")
|
60
|
-
|
61
|
-
tell_me(msg, nil, newline)
|
62
|
-
elsif @trace
|
63
|
-
STDERR.puts "#{msg}#{newline}"
|
64
|
-
end
|
61
|
+
tell_me(msg, nil, newline)
|
65
62
|
end
|
66
63
|
|
67
64
|
def silence
|
@@ -1,3 +1,11 @@
|
|
1
|
+
# We forcibly require OpenSSL, because net/http/persistent will only autoload
|
2
|
+
# it. On some Rubies, autoload fails but explicit require succeeds.
|
3
|
+
begin
|
4
|
+
require 'openssl'
|
5
|
+
rescue LoadError
|
6
|
+
# some Ruby builds don't have OpenSSL
|
7
|
+
end
|
8
|
+
|
1
9
|
vendor = File.expand_path('../vendor', __FILE__)
|
2
10
|
$:.unshift(vendor) unless $:.include?(vendor)
|
3
11
|
require 'net/http/persistent'
|
data/lib/bundler/version.rb
CHANGED
@@ -2,5 +2,5 @@ module Bundler
|
|
2
2
|
# We're doing this because we might write tests that deal
|
3
3
|
# with other versions of bundler and we are unsure how to
|
4
4
|
# handle this better.
|
5
|
-
VERSION = "1.6.
|
5
|
+
VERSION = "1.6.5" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-07-
|
14
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rdiscount
|