aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/fetcher/compact_index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/fetcher/compact_index.rb')
-rw-r--r--lib/bundler/fetcher/compact_index.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb
index 5d703a3a..dcc9d57c 100644
--- a/lib/bundler/fetcher/compact_index.rb
+++ b/lib/bundler/fetcher/compact_index.rb
@@ -3,10 +3,10 @@ require "bundler/fetcher/base"
require "bundler/worker"
module Bundler
+ autoload :CompactIndexClient, "bundler/compact_index_client"
+
class Fetcher
class CompactIndex < Base
- require "bundler/compact_index_client"
-
def self.compact_index_request(method_name)
method = instance_method(method_name)
undef_method(method_name)
@@ -61,6 +61,7 @@ module Bundler
compact_index_request :fetch_spec
def available?
+ return nil unless md5_available?
user_home = Bundler.user_home
return nil unless user_home.directory? && user_home.writable?
# Read info file checksums out of /versions, so we can know if gems are up to date
@@ -119,6 +120,17 @@ module Bundler
Net::HTTPNotModified.new(nil, nil, nil)
end
end
+
+ def md5_available?
+ begin
+ require "openssl"
+ return false if defined?(OpenSSL::OPENSSL_FIPS) && OpenSSL::OPENSSL_FIPS
+ rescue LoadError
+ nil
+ end
+
+ true
+ end
end
end
end