diff options
Diffstat (limited to 'lib/bundler/fetcher')
-rw-r--r-- | lib/bundler/fetcher/base.rb | 1 | ||||
-rw-r--r-- | lib/bundler/fetcher/compact_index.rb | 13 | ||||
-rw-r--r-- | lib/bundler/fetcher/dependency.rb | 3 | ||||
-rw-r--r-- | lib/bundler/fetcher/downloader.rb | 1 | ||||
-rw-r--r-- | lib/bundler/fetcher/index.rb | 1 |
5 files changed, 7 insertions, 12 deletions
diff --git a/lib/bundler/fetcher/base.rb b/lib/bundler/fetcher/base.rb index 271729a534..27987f670a 100644 --- a/lib/bundler/fetcher/base.rb +++ b/lib/bundler/fetcher/base.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Bundler class Fetcher class Base diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 97de88101b..cfc74d642c 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "bundler/fetcher/base" require "bundler/worker" @@ -61,7 +62,7 @@ module Bundler compact_index_request :fetch_spec def available? - return nil unless md5_available? + return nil unless SharedHelpers.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 @@ -120,16 +121,6 @@ module Bundler Net::HTTPNotModified.new(nil, nil, nil) end end - - def md5_available? - require "openssl" - OpenSSL::Digest::MD5.digest("") - true - rescue LoadError - true - rescue OpenSSL::Digest::DigestError - false - end end end end diff --git a/lib/bundler/fetcher/dependency.rb b/lib/bundler/fetcher/dependency.rb index 445b0f2332..1430d1ebeb 100644 --- a/lib/bundler/fetcher/dependency.rb +++ b/lib/bundler/fetcher/dependency.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "bundler/fetcher/base" require "cgi" @@ -6,7 +7,7 @@ module Bundler class Fetcher class Dependency < Base def available? - fetch_uri.scheme != "file" && downloader.fetch(dependency_api_uri) + @available ||= fetch_uri.scheme != "file" && downloader.fetch(dependency_api_uri) rescue NetworkDownError => e raise HTTPError, e.message rescue AuthenticationRequiredError diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb index 453e4645eb..cbc5e220bd 100644 --- a/lib/bundler/fetcher/downloader.rb +++ b/lib/bundler/fetcher/downloader.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + module Bundler class Fetcher class Downloader diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb index d8e212989e..9529944391 100644 --- a/lib/bundler/fetcher/index.rb +++ b/lib/bundler/fetcher/index.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "bundler/fetcher/base" require "rubygems/remote_fetcher" |