Permalink
Browse files

don't actually need USE_PERSISTENT

  • Loading branch information...
1 parent 098360f commit ec49087a5acef97cf4101b89a00b0f21d5b28f67 @indirect indirect committed Mar 7, 2013
Showing with 3 additions and 8 deletions.
  1. +3 −3 lib/bundler/fetcher.rb
  2. +0 −5 lib/bundler/vendored_persistent.rb
View
@@ -59,8 +59,8 @@ def initialize(remote_uri)
@remote_uri = remote_uri
@public_uri = remote_uri.dup
@public_uri.user, @public_uri.password = nil, nil # don't print these
- if USE_PERSISTENT
- @connection ||= Net::HTTP::Persistent.new 'bundler', :ENV
+ if defined?(OpenSSL::SSL)
+ @connection = Net::HTTP::Persistent.new 'bundler', :ENV
else
if @remote_uri.scheme == "https"
raise Bundler::HTTPError, "Could not load OpenSSL.\n" \
@@ -191,7 +191,7 @@ def fetch(uri, counter = 0)
begin
Bundler.ui.debug "Fetching from: #{uri}"
- if USE_PERSISTENT
+ if @connection.is_a?(Net::HTTP::Persistent)
response = @connection.request(uri)
else
req = Net::HTTP::Get.new uri.request_uri
@@ -5,11 +5,6 @@
vendor = File.expand_path('../vendor', __FILE__)
$:.unshift(vendor) unless $:.include?(vendor)
require 'net/http/persistent'
-
- USE_PERSISTENT = true
-
rescue LoadError, NameError => e
require 'net/http'
- USE_PERSISTENT = false
-
end

0 comments on commit ec49087

Please sign in to comment.