Skip to content

Commit b38846d

Browse files
hsbtdeivid-rodriguez
authored andcommitted
[rubygems/rubygems] Make global_gem_cache flag to settings
ruby/rubygems@bfe15a4712 Co-authored-by: David Rodríguez <[email protected]>
1 parent 77e3290 commit b38846d

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed

lib/bundler/feature_flag.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def self.settings_method(name, key, &default)
2727

2828
(1..10).each {|v| define_method("bundler_#{v}_mode?") { @major_version >= v } }
2929

30-
settings_flag(:global_gem_cache) { bundler_5_mode? }
3130
settings_flag(:update_requires_all_flag) { bundler_5_mode? }
3231

3332
settings_option(:default_cli_command) { bundler_4_mode? ? :cli_help : :install }

lib/bundler/settings.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class Settings
8484
"BUNDLE_LOCKFILE_CHECKSUMS" => true,
8585
"BUNDLE_CACHE_ALL" => true,
8686
"BUNDLE_PLUGINS" => true,
87+
"BUNDLE_GLOBAL_GEM_CACHE" => false,
8788
}.freeze
8889

8990
def initialize(root = nil)

lib/bundler/source.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def path?
7979
end
8080

8181
def extension_cache_path(spec)
82-
return unless Bundler.feature_flag.global_gem_cache?
82+
return unless Bundler.settings[:global_gem_cache]
8383
return unless source_slug = extension_cache_slug(spec)
8484
Bundler.user_cache.join(
8585
"extensions", Gem::Platform.local.to_s, Bundler.ruby_scope,

lib/bundler/source/git.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def load_spec_files
238238
# across different projects, this cache will be shared.
239239
# When using local git repos, this is set to the local repo.
240240
def cache_path
241-
@cache_path ||= if Bundler.feature_flag.global_gem_cache?
241+
@cache_path ||= if Bundler.settings[:global_gem_cache]
242242
Bundler.user_cache
243243
else
244244
Bundler.bundle_path.join("cache", "bundler")

lib/bundler/source/rubygems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def download_gem(spec, download_cache_path, previous_spec = nil)
493493
# @return [Pathname] The global cache path.
494494
#
495495
def download_cache_path(spec)
496-
return unless Bundler.feature_flag.global_gem_cache?
496+
return unless Bundler.settings[:global_gem_cache]
497497
return unless remote = spec.remote
498498
return unless cache_slug = remote.cache_slug
499499

0 commit comments

Comments
 (0)