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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdd61d3f649a2286c95d0bc5515d4ea65c973eb9
4
- data.tar.gz: 76e9fa0bc5815e53bb843aba5740beb312c0e431
3
+ metadata.gz: b7fccfcec378505ae78a308e9f840497a8a6593f
4
+ data.tar.gz: 36f474d0d2bd87d1d4883e7b452dc3b9f44a8e84
5
5
  SHA512:
6
- metadata.gz: b8632f839d3b851aa0616049fba43da47ae30cb3ccb2ec08b17bff58500918587734e5355fea0b4315b60a393a573a11991bac41c606a4762ec69dbe76f60c36
7
- data.tar.gz: 03c4b99989fc26da6126342f4e79625d153bb06c1675b426fd64bb1e2570592e8123c5c5adddcc4bfff8e7dc9ec5c0331b01d724f8d9e7d25e6d38f1a3445d34
6
+ metadata.gz: 7052ec5a2415965569c0a85a1c403b40b37eaa642fc3bb512cd80690505661dc1cf658bfd24100d1146faa28c904e94074e5be64783845b1be139248d449981f
7
+ data.tar.gz: 6cfc213cafa8e3c381dd52c04b20a6eec60dc6471c4d197694893834ce5cad1d97fec10c723432a352b2393c24d3e29387bfbab2864338c3c62339742c589375
@@ -1,3 +1,9 @@
1
+ ## 1.6.5 (2014-07-23)
2
+
3
+ Bugfixes:
4
+
5
+ - require openssl explicitly to fix rare HTTPS request failures (@indirect, #3107)
6
+
1
7
  ## 1.6.4 (2014-07-17)
2
8
 
3
9
  Bugfixes:
@@ -189,7 +189,7 @@ module Bundler
189
189
  end
190
190
 
191
191
  def root
192
- default_gemfile.dirname.expand_path
192
+ @root ||= default_gemfile.dirname.expand_path
193
193
  end
194
194
 
195
195
  def app_config_path
@@ -91,47 +91,43 @@ module Bundler
91
91
  end
92
92
 
93
93
  def initialize(remote_uri)
94
-
95
- # How many redirects to allew in one request
96
- @redirect_limit = 5
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
- return @connection if @connection
111
-
112
- needs_ssl = @remote_uri.scheme == "https" ||
113
- Bundler.settings[:ssl_verify_mode] ||
114
- Bundler.settings[:ssl_client_cert]
115
- raise SSLError if needs_ssl && !defined?(OpenSSL)
116
-
117
- @connection = Net::HTTP::Persistent.new 'bundler', :ENV
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
- if @remote_uri.scheme == "https"
120
- @connection.verify_mode = (Bundler.settings[:ssl_verify_mode] ||
121
- OpenSSL::SSL::VERIFY_PEER)
122
- @connection.cert_store = bundler_cert_store
123
- end
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
- if Bundler.settings[:ssl_client_cert]
126
- pem = File.read(Bundler.settings[:ssl_client_cert])
127
- @connection.cert = OpenSSL::X509::Certificate.new(pem)
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 "Fetching from: #{uri}"
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
 
@@ -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
- if debug?
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'
@@ -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.4" unless defined?(::Bundler::VERSION)
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
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-18 00:00:00.000000000 Z
14
+ date: 2014-07-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rdiscount