bundler 2.2.25 → 2.2.27

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42284d8028f6f07937bba73b6c9e55c511c9d14c599b5b2e3b951599a6cff7e7
4
- data.tar.gz: dcda6b29a424bc079333e3a9f5f02f679e7cae039b3dd07e25cb6da6ebf29b4c
3
+ metadata.gz: 5988e5fd0ca1324bf9c9b8e72a362895d08607a7abc9a50505a86bab3fd1edf8
4
+ data.tar.gz: 1b1d0176667a30f138c328ac6a44e303f468786b9449f027c7d4a93343724d85
5
5
  SHA512:
6
- metadata.gz: 9cb7f2e44d450503a5c0786dcc9e3972cfa830180a518de00c5733965c9fe790ab1090611e1da3d2a8cffbd911e2a3c7531b0707a3712efd8c162b95723e827b
7
- data.tar.gz: 0dc46959901b2edf345dbb4b0b448a9762caa91179011899d36939f927379af22b8406ddf4bb17e67c410a7d65c76c43f3c4fcb9c3ec6a4b92dcce82364cdf91
6
+ metadata.gz: 70567def38031cfe17536a800a8c49ec5733a1e3f4e4399fc675bd634dfa7b87f78293bd648b387bc77a0023f06f095d7899516125032a5f7c5de4698f204170
7
+ data.tar.gz: d4c4c08b25b691821035d712cac6f31553c2d73c9b6682d1eb3e355183453cd3980d008f736cc5042d3f7a647181e3ab0875463679192cfc16305232866f5413
data/CHANGELOG.md CHANGED
@@ -1,3 +1,36 @@
1
+ # 2.2.27 (September 3, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Optimize some requires [#4887](https://github.com/rubygems/rubygems/pull/4887)
6
+ - Correctly redact credentials when using x-oauth-basic [#4866](https://github.com/rubygems/rubygems/pull/4866)
7
+
8
+ ## Bug fixes:
9
+
10
+ - Add missing key `branches:` to template for GitHub Actions [#4883](https://github.com/rubygems/rubygems/pull/4883)
11
+ - Fix `bundle plugin install` detection of already installed plugins [#4869](https://github.com/rubygems/rubygems/pull/4869)
12
+ - Make plugin installation idempotent [#4864](https://github.com/rubygems/rubygems/pull/4864)
13
+ - Fix `bundle check` showing duplicated gems when multiple platforms are locked [#4854](https://github.com/rubygems/rubygems/pull/4854)
14
+ - Fix `bundle check` incorrectly considering cached gems [#4853](https://github.com/rubygems/rubygems/pull/4853)
15
+
16
+ # 2.2.26 (August 17, 2021)
17
+
18
+ ## Enhancements:
19
+
20
+ - Remove `RUBYGEMS_GEMDEPS` warning [#4827](https://github.com/rubygems/rubygems/pull/4827)
21
+ - Better defaults for GitHub Actions template generated by `bundle gem` [#4619](https://github.com/rubygems/rubygems/pull/4619)
22
+ - Make `bundle exec` keep file descriptors by default [#4812](https://github.com/rubygems/rubygems/pull/4812)
23
+ - Exclude gemspec file itself from file list of gems generated by `bundle gem` [#4650](https://github.com/rubygems/rubygems/pull/4650)
24
+ - Fix a couple small typos in deprecation / error messages [#4806](https://github.com/rubygems/rubygems/pull/4806)
25
+ - Make script generated by `bundle install --standalone` resilient to moving the application to a differently nested folder when `path` sources are used [#4792](https://github.com/rubygems/rubygems/pull/4792)
26
+ - Exclude CI files and issue templates from file list of gems generated by `bundle gem` [#4033](https://github.com/rubygems/rubygems/pull/4033)
27
+
28
+ ## Bug fixes:
29
+
30
+ - Respect `BUNDLE_USER_HOME` env when choosing config location [#4828](https://github.com/rubygems/rubygems/pull/4828)
31
+ - Fix `bundle gem` on path with spaces [#4816](https://github.com/rubygems/rubygems/pull/4816)
32
+ - Fix bundler hitting the network in some cases where not allowed [#4805](https://github.com/rubygems/rubygems/pull/4805)
33
+
1
34
  # 2.2.25 (July 30, 2021)
2
35
 
3
36
  ## Deprecations:
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2021-07-30".freeze
8
- @git_commit_sha = "7f0f257c7a".freeze
7
+ @built_at = "2021-09-03".freeze
8
+ @git_commit_sha = "b737e1c930".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -12,12 +12,7 @@ module Bundler
12
12
  @options = options
13
13
  @cmd = args.shift
14
14
  @args = args
15
-
16
- if !Bundler.current_ruby.jruby?
17
- @args << { :close_others => !options.keep_file_descriptors? }
18
- elsif options.keep_file_descriptors?
19
- Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
20
- end
15
+ @args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
21
16
  end
22
17
 
23
18
  def run
@@ -184,14 +184,15 @@ module Bundler
184
184
  )
185
185
  end
186
186
 
187
- if File.exist?(target) && !File.directory?(target)
187
+ if target.exist? && !target.directory?
188
188
  Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
189
189
  exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
190
190
  end
191
191
 
192
192
  if use_git
193
193
  Bundler.ui.info "Initializing git repo in #{target}"
194
- `git init #{target}`
194
+ require "shellwords"
195
+ `git init #{target.to_s.shellescape}`
195
196
 
196
197
  config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
197
198
  end
data/lib/bundler/cli.rb CHANGED
@@ -73,14 +73,6 @@ module Bundler
73
73
  Bundler.ui = UI::Shell.new(options)
74
74
  Bundler.ui.level = "debug" if options["verbose"]
75
75
  unprinted_warnings.each {|w| Bundler.ui.warn(w) }
76
-
77
- if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
78
- Bundler.ui.warn(
79
- "The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
80
- "experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
81
- "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
82
- )
83
- end
84
76
  end
85
77
 
86
78
  check_unknown_options!(:except => [:config, :exec])
@@ -469,7 +461,7 @@ module Bundler
469
461
  map aliases_for("cache")
470
462
 
471
463
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
472
- method_option :keep_file_descriptors, :type => :boolean, :default => false
464
+ method_option :keep_file_descriptors, :type => :boolean, :default => true
473
465
  method_option :gemfile, :type => :string, :required => false
474
466
  long_desc <<-D
475
467
  Exec runs a command, providing it access to the gems in the bundle. While using
@@ -477,6 +469,10 @@ module Bundler
477
469
  into the system wide RubyGems repository.
478
470
  D
479
471
  def exec(*args)
472
+ if ARGV.include?("--no-keep-file-descriptors")
473
+ SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
474
+ end
475
+
480
476
  require_relative "cli/exec"
481
477
  Exec.new(options, args).run
482
478
  end
@@ -505,7 +505,7 @@ module Bundler
505
505
  end
506
506
 
507
507
  def precompute_source_requirements_for_indirect_dependencies?
508
- sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
508
+ @remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
509
509
  end
510
510
 
511
511
  def current_ruby_platform_locked?
data/lib/bundler/dsl.rb CHANGED
@@ -457,7 +457,7 @@ repo_name ||= user_name
457
457
  def implicit_global_source_warning
458
458
  Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \
459
459
  "Not using an explicit global source may result in a different lockfile being generated depending on " \
460
- "the gems you have installed locally before bundler is run." \
460
+ "the gems you have installed locally before bundler is run. " \
461
461
  "Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"."
462
462
  end
463
463
 
@@ -122,7 +122,7 @@ module Bundler
122
122
 
123
123
  class VirtualProtocolError < BundlerError
124
124
  def message
125
- "There was an error relating to virtualization and file access." \
125
+ "There was an error relating to virtualization and file access. " \
126
126
  "It is likely that you need to grant access to or mount some file system correctly."
127
127
  end
128
128
 
@@ -12,12 +12,13 @@ module Bundler
12
12
  end
13
13
  File.open File.join(bundler_path, "setup.rb"), "w" do |file|
14
14
  file.puts "require 'rbconfig'"
15
- file.puts "ruby_engine = RUBY_ENGINE"
16
- file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
17
- file.puts "path = File.expand_path('..', __FILE__)"
18
15
  file.puts reverse_rubygems_kernel_mixin
19
16
  paths.each do |path|
20
- file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
17
+ if Pathname.new(path).absolute?
18
+ file.puts %($:.unshift "#{path}")
19
+ else
20
+ file.puts %($:.unshift File.expand_path("\#{__dir__}/#{path}"))
21
+ end
21
22
  end
22
23
  end
23
24
  end
@@ -28,14 +29,14 @@ module Bundler
28
29
  @specs.map do |spec|
29
30
  next if spec.name == "bundler"
30
31
  Array(spec.require_paths).map do |path|
31
- gem_path(path, spec).sub(version_dir, '#{ruby_engine}/#{ruby_version}')
32
+ gem_path(path, spec).sub(version_dir, '#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}')
32
33
  # This is a static string intentionally. It's interpolated at a later time.
33
34
  end
34
- end.flatten
35
+ end.flatten.compact
35
36
  end
36
37
 
37
38
  def version_dir
38
- "#{Bundler::RubyVersion.system.engine}/#{RbConfig::CONFIG["ruby_version"]}"
39
+ "#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}"
39
40
  end
40
41
 
41
42
  def bundler_path
@@ -44,7 +45,11 @@ module Bundler
44
45
 
45
46
  def gem_path(path, spec)
46
47
  full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
47
- Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
48
+ if spec.source.instance_of?(Source::Path)
49
+ full_path
50
+ else
51
+ Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
52
+ end
48
53
  rescue TypeError
49
54
  error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
50
55
  raise Gem::InvalidSpecificationException.new(error_message)
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rubygems/dependency_installer"
4
3
  require_relative "worker"
5
4
  require_relative "installer/parallel_installer"
6
5
  require_relative "installer/standalone"
@@ -81,6 +81,8 @@ module Bundler
81
81
 
82
82
  deps = names.map {|name| Dependency.new name, version }
83
83
 
84
+ Bundler.configure_gem_home_and_path(Plugin.root)
85
+
84
86
  definition = Definition.new(nil, deps, source_list, true)
85
87
  install_definition(definition)
86
88
  end
@@ -13,6 +13,7 @@ module Bundler
13
13
  class MalformattedPlugin < PluginError; end
14
14
  class UndefinedCommandError < PluginError; end
15
15
  class UnknownSourceError < PluginError; end
16
+ class PluginInstallError < PluginError; end
16
17
 
17
18
  PLUGIN_FILE_NAME = "plugins.rb".freeze
18
19
 
@@ -38,12 +39,11 @@ module Bundler
38
39
  specs = Installer.new.install(names, options)
39
40
 
40
41
  save_plugins names, specs
41
- rescue PluginError => e
42
+ rescue PluginError
42
43
  specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }
43
44
  specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) }
44
45
 
45
- names_list = names.map {|name| "`#{name}`" }.join(", ")
46
- Bundler.ui.error "Failed to install the following plugins: #{names_list}. The underlying error was: #{e.message}.\n #{e.backtrace.join("\n ")}"
46
+ raise
47
47
  end
48
48
 
49
49
  # Uninstalls plugins by the given names
@@ -245,10 +245,11 @@ module Bundler
245
245
  # @param [Array<String>] names of inferred source plugins that can be ignored
246
246
  def save_plugins(plugins, specs, optional_plugins = [])
247
247
  plugins.each do |name|
248
+ next if index.installed?(name)
249
+
248
250
  spec = specs[name]
249
- validate_plugin! Pathname.new(spec.full_gem_path)
250
- installed = register_plugin(name, spec, optional_plugins.include?(name))
251
- Bundler.ui.info "Installed plugin #{name}" if installed
251
+
252
+ save_plugin(name, spec, optional_plugins.include?(name))
252
253
  end
253
254
  end
254
255
 
@@ -263,6 +264,22 @@ module Bundler
263
264
  raise MalformattedPlugin, "#{PLUGIN_FILE_NAME} was not found in the plugin." unless plugin_file.file?
264
265
  end
265
266
 
267
+ # Validates and registers a plugin.
268
+ #
269
+ # @param [String] name the name of the plugin
270
+ # @param [Specification] spec of installed plugin
271
+ # @param [Boolean] optional_plugin, removed if there is conflict with any
272
+ # other plugin (used for default source plugins)
273
+ #
274
+ # @raise [PluginInstallError] if validation or registration raises any error
275
+ def save_plugin(name, spec, optional_plugin = false)
276
+ validate_plugin! Pathname.new(spec.full_gem_path)
277
+ installed = register_plugin(name, spec, optional_plugin)
278
+ Bundler.ui.info "Installed plugin #{name}" if installed
279
+ rescue PluginError => e
280
+ raise PluginInstallError, "Failed to install plugin `#{spec.name}`, due to #{e.class} (#{e.message})"
281
+ end
282
+
266
283
  # Runs the plugins.rb file in an isolated namespace, records the plugin
267
284
  # actions it registers for and then passes the data to index to be stored.
268
285
  #
@@ -255,12 +255,6 @@ module Bundler
255
255
  next if name == "bundler"
256
256
  next unless search_for(requirement).empty?
257
257
 
258
- cache_message = begin
259
- " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
260
- rescue GemfileNotFound
261
- nil
262
- end
263
-
264
258
  if (base = @base[name]) && !base.empty?
265
259
  version = base.first.version
266
260
  message = "You have requested:\n" \
@@ -269,18 +263,17 @@ module Bundler
269
263
  "Try running `bundle update #{name}`\n\n" \
270
264
  "If you are updating multiple gems in your Gemfile at once,\n" \
271
265
  "try passing them all to `bundle update`"
272
- elsif source = @source_requirements[name]
266
+ else
267
+ source = source_for(name)
273
268
  specs = source.specs.search(name)
274
269
  versions_with_platforms = specs.map {|s| [s.version, s.platform] }
275
- message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
276
- message << if versions_with_platforms.any?
277
- "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
278
- else
279
- "The source does not contain any versions of '#{name}'"
280
- end
281
- else
282
- message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
283
- "listed in your Gemfile#{cache_message}."
270
+ cache_message = begin
271
+ " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
272
+ rescue GemfileNotFound
273
+ nil
274
+ end
275
+ message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source.to_err}#{cache_message}.\n")
276
+ message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
284
277
  end
285
278
  raise GemNotFound, message
286
279
  end
@@ -378,7 +371,7 @@ module Bundler
378
371
  o << if metadata_requirement
379
372
  "is not available in #{relevant_source}"
380
373
  else
381
- "in #{relevant_source}.\n"
374
+ "in #{relevant_source.to_err}.\n"
382
375
  end
383
376
  end
384
377
  end,
@@ -34,10 +34,12 @@ module Bundler
34
34
  end
35
35
 
36
36
  def build_args
37
+ require "rubygems/command"
37
38
  Gem::Command.build_args
38
39
  end
39
40
 
40
41
  def build_args=(args)
42
+ require "rubygems/command"
41
43
  Gem::Command.build_args = args
42
44
  end
43
45
 
@@ -419,7 +419,15 @@ module Bundler
419
419
  elsif is_credential(key)
420
420
  "[REDACTED]"
421
421
  elsif is_userinfo(converted)
422
- converted.gsub(/:.*$/, ":[REDACTED]")
422
+ username, pass = converted.split(":", 2)
423
+
424
+ if pass == "x-oauth-basic"
425
+ username = "[REDACTED]"
426
+ else
427
+ pass = "[REDACTED]"
428
+ end
429
+
430
+ [username, pass].join(":")
423
431
  else
424
432
  converted
425
433
  end
@@ -430,6 +438,8 @@ module Bundler
430
438
  Pathname.new(ENV["BUNDLE_CONFIG"])
431
439
  elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
432
440
  Pathname.new(ENV["BUNDLE_USER_CONFIG"])
441
+ elsif ENV["BUNDLE_USER_HOME"] && !ENV["BUNDLE_USER_HOME"].empty?
442
+ Pathname.new(ENV["BUNDLE_USER_HOME"]).join("config")
433
443
  elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
434
444
  Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
435
445
  end
@@ -29,6 +29,7 @@ module Bundler
29
29
  def local_only!
30
30
  @specs = nil
31
31
  @allow_local = true
32
+ @allow_cached = false
32
33
  @allow_remote = false
33
34
  end
34
35
 
@@ -50,6 +51,7 @@ module Bundler
50
51
  return if @allow_cached
51
52
 
52
53
  @specs = nil
54
+ @allow_local = true
53
55
  @allow_cached = true
54
56
  end
55
57
 
@@ -96,11 +98,22 @@ module Bundler
96
98
  out << " specs:\n"
97
99
  end
98
100
 
101
+ def to_err
102
+ if remotes.empty?
103
+ "locally installed gems"
104
+ elsif @allow_remote
105
+ "rubygems repository #{remote_names} or installed locally"
106
+ elsif @allow_cached
107
+ "cached gems from rubygems repository #{remote_names} or installed locally"
108
+ else
109
+ "locally installed gems"
110
+ end
111
+ end
112
+
99
113
  def to_s
100
114
  if remotes.empty?
101
115
  "locally installed gems"
102
116
  else
103
- remote_names = remotes.map(&:to_s).join(", ")
104
117
  "rubygems repository #{remote_names} or installed locally"
105
118
  end
106
119
  end
@@ -131,7 +144,7 @@ module Bundler
131
144
  end
132
145
  end
133
146
 
134
- if (installed?(spec) || Plugin.installed?(spec.name)) && !force
147
+ if installed?(spec) && !force
135
148
  print_using_message "Using #{version_message(spec)}"
136
149
  return nil # no post-install message
137
150
  end
@@ -319,6 +332,10 @@ module Bundler
319
332
 
320
333
  protected
321
334
 
335
+ def remote_names
336
+ remotes.map(&:to_s).join(", ")
337
+ end
338
+
322
339
  def credless_remotes
323
340
  remotes.map(&method(:suppress_configured_credentials))
324
341
  end
@@ -16,6 +16,10 @@ module Bundler
16
16
  @index
17
17
  end
18
18
 
19
+ def to_err
20
+ to_s
21
+ end
22
+
19
23
  def to_s
20
24
  "any of the sources"
21
25
  end
@@ -67,6 +67,10 @@ module Bundler
67
67
  "#<#{self.class}:0x#{object_id} #{self}>"
68
68
  end
69
69
 
70
+ def to_err
71
+ to_s
72
+ end
73
+
70
74
  def path?
71
75
  instance_of?(Bundler::Source::Path)
72
76
  end
@@ -24,7 +24,7 @@ module Bundler
24
24
 
25
25
  specs_for_dep = spec_for_dependency(dep, match_current_platform)
26
26
  if specs_for_dep.any?
27
- specs += specs_for_dep
27
+ match_current_platform ? specs += specs_for_dep : specs |= specs_for_dep
28
28
 
29
29
  specs_for_dep.first.dependencies.each do |d|
30
30
  next if d.type == :development
@@ -1,16 +1,27 @@
1
1
  name: Ruby
2
2
 
3
- on: [push,pull_request]
3
+ on:
4
+ push:
5
+ branches:
6
+ - <%= config[:git_default_branch] %>
7
+
8
+ pull_request:
4
9
 
5
10
  jobs:
6
11
  build:
7
12
  runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ ruby:
17
+ - <%= RUBY_VERSION %>
18
+
8
19
  steps:
9
20
  - uses: actions/checkout@v2
10
21
  - name: Set up Ruby
11
22
  uses: ruby/setup-ruby@v1
12
23
  with:
13
- ruby-version: <%= RUBY_VERSION %>
24
+ ruby-version: ${{ matrix.ruby }}
14
25
  bundler-cache: true
15
26
  - name: Run the default task
16
27
  run: bundle exec rake
@@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
25
25
  # Specify which files should be added to the gem when it is released.
26
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
27
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
28
+ `git ls-files -z`.split("\x0").reject do |f|
29
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
30
+ end
29
31
  end
30
32
  spec.bindir = "exe"
31
33
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.25".freeze
4
+ VERSION = "2.2.27".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/bundler.rb CHANGED
@@ -636,6 +636,12 @@ EOF
636
636
  @rubygems = nil
637
637
  end
638
638
 
639
+ def configure_gem_home_and_path(path = bundle_path)
640
+ configure_gem_path
641
+ configure_gem_home(path)
642
+ Bundler.rubygems.clear_paths
643
+ end
644
+
639
645
  private
640
646
 
641
647
  def eval_yaml_gemspec(path, contents)
@@ -656,29 +662,17 @@ EOF
656
662
  raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
657
663
  end
658
664
 
659
- def configure_gem_home_and_path
660
- configure_gem_path
661
- configure_gem_home
662
- bundle_path
663
- end
664
-
665
- def configure_gem_path(env = ENV)
666
- blank_home = env["GEM_HOME"].nil? || env["GEM_HOME"].empty?
667
- if !use_system_gems?
665
+ def configure_gem_path
666
+ unless use_system_gems?
668
667
  # this needs to be empty string to cause
669
668
  # PathSupport.split_gem_path to only load up the
670
669
  # Bundler --path setting as the GEM_PATH.
671
- env["GEM_PATH"] = ""
672
- elsif blank_home
673
- possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
674
- paths = possibles.flatten.compact.uniq.reject(&:empty?)
675
- env["GEM_PATH"] = paths.join(File::PATH_SEPARATOR)
670
+ Bundler::SharedHelpers.set_env "GEM_PATH", ""
676
671
  end
677
672
  end
678
673
 
679
- def configure_gem_home
680
- Bundler::SharedHelpers.set_env "GEM_HOME", File.expand_path(bundle_path, root)
681
- Bundler.rubygems.clear_paths
674
+ def configure_gem_home(path)
675
+ Bundler::SharedHelpers.set_env "GEM_HOME", path.to_s
682
676
  end
683
677
 
684
678
  def tmp_home_path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.25
4
+ version: 2.2.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
@@ -22,7 +22,7 @@ authors:
22
22
  autorequire:
23
23
  bindir: exe
24
24
  cert_chain: []
25
- date: 2021-07-30 00:00:00.000000000 Z
25
+ date: 2021-09-03 00:00:00.000000000 Z
26
26
  dependencies: []
27
27
  description: Bundler manages an application's dependencies through its entire life,
28
28
  across many machines, systematically and repeatably
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
354
354
  - !ruby/object:Gem::Version
355
355
  version: 2.5.2
356
356
  requirements: []
357
- rubygems_version: 3.2.25
357
+ rubygems_version: 3.2.27
358
358
  signing_key:
359
359
  specification_version: 4
360
360
  summary: The best way to manage your application's dependencies