summaryrefslogtreecommitdiff
path: root/lib/bundler/fetcher/compact_index.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2021-04-21 13:54:29 +0200
committerHiroshi SHIBATA <[email protected]>2021-05-11 11:29:41 +0900
commit5b0abba9317f206913cf2e599d0dac7e9dbd0baa (patch)
tree81e092eaf8b048df4d64eebe8b1c51626f751e9b /lib/bundler/fetcher/compact_index.rb
parent15160e9b4feba5d531601a4f626b3132d4749629 (diff)
Sync bundler & rubygems
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4367
Diffstat (limited to 'lib/bundler/fetcher/compact_index.rb')
-rw-r--r--lib/bundler/fetcher/compact_index.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb
index 0304155bdd..27969d74ec 100644
--- a/lib/bundler/fetcher/compact_index.rb
+++ b/lib/bundler/fetcher/compact_index.rb
@@ -68,11 +68,16 @@ module Bundler
compact_index_request :fetch_spec
def available?
- return nil unless SharedHelpers.md5_available?
- user_home = Bundler.user_home
- return nil unless user_home.directory? && user_home.writable?
+ unless SharedHelpers.md5_available?
+ Bundler.ui.debug("FIPS mode is enabled, bundler can't use the CompactIndex API")
+ return nil
+ end
+ if fetch_uri.scheme == "file"
+ Bundler.ui.debug("Using a local server, bundler won't use the CompactIndex API")
+ return false
+ end
# Read info file checksums out of /versions, so we can know if gems are up to date
- fetch_uri.scheme != "file" && compact_index_client.update_and_parse_checksums!
+ compact_index_client.update_and_parse_checksums!
rescue CompactIndexClient::Updater::MisMatchedChecksumError => e
Bundler.ui.debug(e.message)
nil