bundler 2.3.15 → 2.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90ea0eb8e0cfa7a8f3c4cbbaaf462526decabe37e575a4d180e1565b8770ae9e
4
- data.tar.gz: '050481f0d752f3e519b3d830f9f9f873b48d2e38879cc7a1ccb35ace0ee75c01'
3
+ metadata.gz: '0194bb060d38ce7786c704aca693890461b4866ee647d6931a8e3e8f738f4ad6'
4
+ data.tar.gz: d6e46c6028248ad29a24bfccd9df89facbcd57186e84be8499ec903f4989b88e
5
5
  SHA512:
6
- metadata.gz: 5e1de206741c6d35bbfaa5fb41b9af2b15dc08050831e51c92b2e7a9038f040e5a9326ba1bb21350e320c7f1c3a98174eae752fba042ff3a6911886e6f5c8fc1
7
- data.tar.gz: 8dbccee1de0304584cb0f7a34d14f55e3d1accc5d298d0f676c2d967150d739e7b9916ca4c4b0ed5d6a7ce53d7d586946ec560e97367044257c2907e8bba2308
6
+ metadata.gz: 9bbc74e0583c0117895f09cc1da2ae5dc9592b09b52f70f70c8efba2743bec7449230b9fc8d7210725c804bb761f98bd9a0ec8a8e417bfc2b0573154ffaacab7
7
+ data.tar.gz: a27eea8f0ebceb3d0e9e8b413d2c50da519c36e565e08c26f0d22f6298f75515f0d11094da6c510b74805ceae2e18e25cd61eacd40e328b565878f4ad2c66a41
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 2.3.16 (June 15, 2022)
2
+
3
+ ## Performance:
4
+
5
+ - Improve performance of installing gems from gem server sources [#5614](https://github.com/rubygems/rubygems/pull/5614)
6
+
1
7
  # 2.3.15 (June 1, 2022)
2
8
 
3
9
  ## Enhancements:
@@ -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 = "2022-06-01".freeze
8
- @git_commit_sha = "e7e41afd92".freeze
7
+ @built_at = "2022-06-15".freeze
8
+ @git_commit_sha = "324ee6e542".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -14,7 +14,7 @@ module Bundler
14
14
  Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
15
15
 
16
16
  setup_cache_all
17
- install
17
+ install unless Bundler.settings[:no_install]
18
18
 
19
19
  # TODO: move cache contents here now that all bundles are locked
20
20
  custom_path = Bundler.settings[:path] if options[:path]
@@ -161,8 +161,6 @@ module Bundler
161
161
 
162
162
  Bundler.settings.set_command_option_if_given :no_prune, options["no-prune"]
163
163
 
164
- Bundler.settings.set_command_option_if_given :no_install, options["no-install"]
165
-
166
164
  Bundler.settings.set_command_option_if_given :clean, options["clean"]
167
165
 
168
166
  normalize_groups if options[:without] || options[:with]
data/lib/bundler/cli.rb CHANGED
@@ -251,9 +251,7 @@ module Bundler
251
251
  remembered_negative_flag_deprecation("no-deployment")
252
252
 
253
253
  require_relative "cli/install"
254
- Bundler.settings.temporary(:no_install => false) do
255
- Install.new(options.dup).run
256
- end
254
+ Install.new(options.dup).run
257
255
  end
258
256
 
259
257
  map aliases_for("install")
@@ -299,9 +297,7 @@ module Bundler
299
297
  def update(*gems)
300
298
  SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
301
299
  require_relative "cli/update"
302
- Bundler.settings.temporary(:no_install => false) do
303
- Update.new(options, gems).run
304
- end
300
+ Update.new(options, gems).run
305
301
  end
306
302
 
307
303
  desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
@@ -255,20 +255,18 @@ module Bundler
255
255
  #
256
256
  # @return [SpecSet] resolved dependencies
257
257
  def resolve
258
- @resolve ||= begin
259
- if Bundler.frozen_bundle?
260
- Bundler.ui.debug "Frozen, using resolution from the lockfile"
261
- @locked_specs
262
- elsif !unlocking? && nothing_changed?
263
- Bundler.ui.debug("Found no changes, using resolution from the lockfile")
264
- SpecSet.new(filter_specs(@locked_specs, @dependencies.select {|dep| @locked_specs[dep].any? }))
265
- else
266
- last_resolve = converge_locked_specs
267
- # Run a resolve against the locally available gems
268
- Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
269
- expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
270
- Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
271
- end
258
+ @resolve ||= if Bundler.frozen_bundle?
259
+ Bundler.ui.debug "Frozen, using resolution from the lockfile"
260
+ @locked_specs
261
+ elsif !unlocking? && nothing_changed?
262
+ Bundler.ui.debug("Found no changes, using resolution from the lockfile")
263
+ SpecSet.new(filter_specs(@locked_specs, @dependencies.select {|dep| @locked_specs[dep].any? }))
264
+ else
265
+ last_resolve = converge_locked_specs
266
+ # Run a resolve against the locally available gems
267
+ Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
268
+ expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, true)
269
+ Resolver.resolve(expanded_dependencies, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
272
270
  end
273
271
  end
274
272
 
@@ -735,12 +733,10 @@ module Bundler
735
733
  end
736
734
 
737
735
  def metadata_dependencies
738
- @metadata_dependencies ||= begin
739
- [
740
- Dependency.new("Ruby\0", RubyVersion.system.gem_version),
741
- Dependency.new("RubyGems\0", Gem::VERSION),
742
- ]
743
- end
736
+ @metadata_dependencies ||= [
737
+ Dependency.new("Ruby\0", RubyVersion.system.gem_version),
738
+ Dependency.new("RubyGems\0", Gem::VERSION),
739
+ ]
744
740
  end
745
741
 
746
742
  def expand_dependencies(dependencies, remote = false)
@@ -9,6 +9,7 @@ module Bundler
9
9
  attr_reader :autorequire
10
10
  attr_reader :groups, :platforms, :gemfile, :git, :github, :branch, :ref
11
11
 
12
+ # rubocop:disable Naming/VariableNumber
12
13
  PLATFORM_MAP = {
13
14
  :ruby => Gem::Platform::RUBY,
14
15
  :ruby_18 => Gem::Platform::RUBY,
@@ -91,6 +92,7 @@ module Bundler
91
92
  :x64_mingw_30 => Gem::Platform::X64_MINGW,
92
93
  :x64_mingw_31 => Gem::Platform::X64_MINGW,
93
94
  }.freeze
95
+ # rubocop:enable Naming/VariableNumber
94
96
 
95
97
  def initialize(name, version, options = {}, &blk)
96
98
  type = options["type"] || :runtime
data/lib/bundler/dsl.rb CHANGED
@@ -511,9 +511,7 @@ module Bundler
511
511
  # be raised.
512
512
  #
513
513
  def contents
514
- @contents ||= begin
515
- dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
516
- end
514
+ @contents ||= dsl_path && File.exist?(dsl_path) && File.read(dsl_path)
517
515
  end
518
516
 
519
517
  # The message of the exception reports the content of podspec for the
@@ -41,12 +41,14 @@ module Bundler
41
41
  class GemspecError < BundlerError; status_code(14); end
42
42
  class InvalidOption < BundlerError; status_code(15); end
43
43
  class ProductionError < BundlerError; status_code(16); end
44
+
44
45
  class HTTPError < BundlerError
45
46
  status_code(17)
46
47
  def filter_uri(uri)
47
48
  URICredentialsFilter.credential_filtered_uri(uri)
48
49
  end
49
50
  end
51
+
50
52
  class RubyVersionMismatch < BundlerError; status_code(18); end
51
53
  class SecurityError < BundlerError; status_code(19); end
52
54
  class LockfileError < BundlerError; status_code(20); end
@@ -19,14 +19,12 @@ module Bundler
19
19
  end
20
20
 
21
21
  def fetch_uri
22
- @fetch_uri ||= begin
23
- if remote_uri.host == "rubygems.org"
24
- uri = remote_uri.dup
25
- uri.host = "index.rubygems.org"
26
- uri
27
- else
28
- remote_uri
29
- end
22
+ @fetch_uri ||= if remote_uri.host == "rubygems.org"
23
+ uri = remote_uri.dup
24
+ uri.host = "index.rubygems.org"
25
+ uri
26
+ else
27
+ remote_uri
30
28
  end
31
29
  end
32
30
 
@@ -20,6 +20,7 @@ module Bundler
20
20
  class TooManyRequestsError < HTTPError; end
21
21
  # This error is raised if the API returns a 413 (only printed in verbose)
22
22
  class FallbackError < HTTPError; end
23
+
23
24
  # This is the error raised if OpenSSL fails the cert verification
24
25
  class CertificateFailureError < HTTPError
25
26
  def initialize(remote_uri)
@@ -33,6 +34,7 @@ module Bundler
33
34
  " sources and change 'https' to 'http'."
34
35
  end
35
36
  end
37
+
36
38
  # This is the error raised when a source is HTTPS and OpenSSL didn't load
37
39
  class SSLError < HTTPError
38
40
  def initialize(msg = nil)
@@ -42,6 +44,7 @@ module Bundler
42
44
  "using RVM are available at rvm.io/packages/openssl."
43
45
  end
44
46
  end
47
+
45
48
  # This error is raised if HTTP authentication is required, but not provided.
46
49
  class AuthenticationRequiredError < HTTPError
47
50
  def initialize(remote_uri)
@@ -52,6 +55,7 @@ module Bundler
52
55
  "or by storing the credentials in the `#{Settings.key_for(remote_uri)}` environment variable"
53
56
  end
54
57
  end
58
+
55
59
  # This error is raised if HTTP authentication is provided, but incorrect.
56
60
  class BadAuthenticationError < HTTPError
57
61
  def initialize(remote_uri)
@@ -258,7 +258,7 @@ module Bundler
258
258
  @dependencies |= Array(names)
259
259
  end
260
260
 
261
- # Note: Do not override if you don't know what you are doing.
261
+ # NOTE: Do not override if you don't know what you are doing.
262
262
  def can_lock?(spec)
263
263
  spec.source == self
264
264
  end
@@ -285,7 +285,7 @@ module Bundler
285
285
  end
286
286
  alias_method :identifier, :to_s
287
287
 
288
- # Note: Do not override if you don't know what you are doing.
288
+ # NOTE: Do not override if you don't know what you are doing.
289
289
  def include?(other)
290
290
  other == self
291
291
  end
@@ -294,7 +294,7 @@ module Bundler
294
294
  SharedHelpers.digest(:SHA1).hexdigest(uri)
295
295
  end
296
296
 
297
- # Note: Do not override if you don't know what you are doing.
297
+ # NOTE: Do not override if you don't know what you are doing.
298
298
  def gem_install_dir
299
299
  Bundler.install_path
300
300
  end
@@ -233,19 +233,17 @@ module Bundler
233
233
  # before dependencies that are unconstrained
234
234
  def amount_constrained(dependency)
235
235
  @amount_constrained ||= {}
236
- @amount_constrained[dependency.name] ||= begin
237
- if (base = @base[dependency.name]) && !base.empty?
238
- dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
239
- else
240
- all = index_for(dependency).search(dependency.name).size
236
+ @amount_constrained[dependency.name] ||= if (base = @base[dependency.name]) && !base.empty?
237
+ dependency.requirement.satisfied_by?(base.first.version) ? 0 : 1
238
+ else
239
+ all = index_for(dependency).search(dependency.name).size
241
240
 
242
- if all <= 1
243
- all - 1_000_000
244
- else
245
- search = search_for(dependency)
246
- search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? }
247
- search - all
248
- end
241
+ if all <= 1
242
+ all - 1_000_000
243
+ else
244
+ search = search_for(dependency)
245
+ search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? }
246
+ search - all
249
247
  end
250
248
  end
251
249
  end
@@ -90,6 +90,14 @@ module Bundler
90
90
  end
91
91
  end
92
92
 
93
+ def spec
94
+ if Bundler.rubygems.provides?("< 3.3.12") # RubyGems implementation rescues and re-raises errors before 3.3.12 and we don't want that
95
+ @package.spec
96
+ else
97
+ super
98
+ end
99
+ end
100
+
93
101
  private
94
102
 
95
103
  def strict_rm_rf(dir)
@@ -203,20 +203,9 @@ module Bundler
203
203
  EXT_LOCK
204
204
  end
205
205
 
206
- def spec_from_gem(path, policy = nil)
207
- require "rubygems/security"
208
- require "psych"
209
- gem_from_path(path, security_policies[policy]).spec
210
- rescue Exception, Gem::Exception, Gem::Security::Exception => e # rubocop:disable Lint/RescueException
211
- if e.is_a?(Gem::Security::Exception) ||
212
- e.message =~ /unknown trust policy|unsigned gem/i ||
213
- e.message =~ /couldn't verify (meta)?data signature/i
214
- raise SecurityError,
215
- "The gem #{File.basename(path, ".gem")} can't be installed because " \
216
- "the security policy didn't allow it, with the message: #{e.message}"
217
- else
218
- raise e
219
- end
206
+ def spec_from_gem(path)
207
+ require "rubygems/package"
208
+ Gem::Package.new(path).spec
220
209
  end
221
210
 
222
211
  def build_gem(gem_dir, spec)
@@ -514,13 +503,6 @@ module Bundler
514
503
  Gem::RemoteFetcher.new(proxy)
515
504
  end
516
505
 
517
- def gem_from_path(path, policy = nil)
518
- require "rubygems/package"
519
- p = Gem::Package.new(path)
520
- p.security_policy = policy if policy
521
- p
522
- end
523
-
524
506
  def build(spec, skip_validation = false)
525
507
  require "rubygems/package"
526
508
  Gem::Package.build(spec, skip_validation)
@@ -219,13 +219,11 @@ module Bundler
219
219
  # across different projects, this cache will be shared.
220
220
  # When using local git repos, this is set to the local repo.
221
221
  def cache_path
222
- @cache_path ||= begin
223
- if Bundler.requires_sudo? || Bundler.feature_flag.global_gem_cache?
224
- Bundler.user_cache
225
- else
226
- Bundler.bundle_path.join("cache", "bundler")
227
- end.join("git", git_scope)
228
- end
222
+ @cache_path ||= if Bundler.requires_sudo? || Bundler.feature_flag.global_gem_cache?
223
+ Bundler.user_cache
224
+ else
225
+ Bundler.bundle_path.join("cache", "bundler")
226
+ end.join("git", git_scope)
229
227
  end
230
228
 
231
229
  def app_cache_dirname
@@ -139,13 +139,9 @@ module Bundler
139
139
  force = options[:force]
140
140
  ensure_builtin_gems_cached = options[:ensure_builtin_gems_cached]
141
141
 
142
- if ensure_builtin_gems_cached && spec.default_gem?
143
- if !cached_path(spec)
144
- cached_built_in_gem(spec) unless spec.remote
145
- force = true
146
- else
147
- spec.loaded_from = loaded_from(spec)
148
- end
142
+ if ensure_builtin_gems_cached && spec.default_gem? && !cached_path(spec)
143
+ cached_built_in_gem(spec) unless spec.remote
144
+ force = true
149
145
  end
150
146
 
151
147
  if installed?(spec) && !force
@@ -153,84 +149,90 @@ module Bundler
153
149
  return nil # no post-install message
154
150
  end
155
151
 
156
- # Download the gem to get the spec, because some specs that are returned
157
- # by rubygems.org are broken and wrong.
158
152
  if spec.remote
159
153
  # Check for this spec from other sources
160
- uris = [spec.remote.anonymized_uri]
161
- uris += remotes_for_spec(spec).map(&:anonymized_uri)
162
- uris.uniq!
154
+ uris = [spec.remote, *remotes_for_spec(spec)].map(&:anonymized_uri).uniq
163
155
  Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
164
156
 
165
157
  path = fetch_gem(spec, options[:previous_spec])
166
- begin
167
- s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"])
168
- spec.__swap__(s)
158
+ else
159
+ path = cached_gem(spec)
160
+ raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
161
+ end
162
+
163
+ if requires_sudo?
164
+ install_path = Bundler.tmp(spec.full_name)
165
+ bin_path = install_path.join("bin")
166
+ else
167
+ install_path = rubygems_dir
168
+ bin_path = Bundler.system_bindir
169
+ end
170
+
171
+ Bundler.mkdir_p bin_path, :no_sudo => true unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
172
+
173
+ require_relative "../rubygems_gem_installer"
174
+
175
+ installer = Bundler::RubyGemsGemInstaller.at(
176
+ path,
177
+ :security_policy => Bundler.rubygems.security_policies[Bundler.settings["trust-policy"]],
178
+ :install_dir => install_path.to_s,
179
+ :bin_dir => bin_path.to_s,
180
+ :ignore_dependencies => true,
181
+ :wrappers => true,
182
+ :env_shebang => true,
183
+ :build_args => options[:build_args],
184
+ :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
185
+ :bundler_extension_cache_path => extension_cache_path(spec)
186
+ )
187
+
188
+ if spec.remote
189
+ s = begin
190
+ installer.spec
169
191
  rescue Gem::Package::FormatError
170
192
  Bundler.rm_rf(path)
171
193
  raise
194
+ rescue Gem::Security::Exception => e
195
+ raise SecurityError,
196
+ "The gem #{File.basename(path, ".gem")} can't be installed because " \
197
+ "the security policy didn't allow it, with the message: #{e.message}"
172
198
  end
199
+
200
+ spec.__swap__(s)
173
201
  end
174
202
 
175
- unless Bundler.settings[:no_install]
176
- message = "Installing #{version_message(spec, options[:previous_spec])}"
177
- message += " with native extensions" if spec.extensions.any?
178
- Bundler.ui.confirm message
203
+ message = "Installing #{version_message(spec, options[:previous_spec])}"
204
+ message += " with native extensions" if spec.extensions.any?
205
+ Bundler.ui.confirm message
179
206
 
180
- path = cached_gem(spec)
181
- raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path
182
- if requires_sudo?
183
- install_path = Bundler.tmp(spec.full_name)
184
- bin_path = install_path.join("bin")
185
- else
186
- install_path = rubygems_dir
187
- bin_path = Bundler.system_bindir
188
- end
207
+ installed_spec = installer.install
208
+
209
+ spec.full_gem_path = installed_spec.full_gem_path
210
+ spec.loaded_from = installed_spec.loaded_from
189
211
 
190
- Bundler.mkdir_p bin_path, :no_sudo => true unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
191
-
192
- require_relative "../rubygems_gem_installer"
193
-
194
- installed_spec = Bundler::RubyGemsGemInstaller.at(
195
- path,
196
- :install_dir => install_path.to_s,
197
- :bin_dir => bin_path.to_s,
198
- :ignore_dependencies => true,
199
- :wrappers => true,
200
- :env_shebang => true,
201
- :build_args => options[:build_args],
202
- :bundler_expected_checksum => spec.respond_to?(:checksum) && spec.checksum,
203
- :bundler_extension_cache_path => extension_cache_path(spec)
204
- ).install
205
- spec.full_gem_path = installed_spec.full_gem_path
206
-
207
- # SUDO HAX
208
- if requires_sudo?
209
- Bundler.rubygems.repository_subdirectories.each do |name|
210
- src = File.join(install_path, name, "*")
211
- dst = File.join(rubygems_dir, name)
212
- if name == "extensions" && Dir.glob(src).any?
213
- src = File.join(src, "*/*")
214
- ext_src = Dir.glob(src).first
215
- ext_src.gsub!(src[0..-6], "")
216
- dst = File.dirname(File.join(dst, ext_src))
217
- end
218
- SharedHelpers.filesystem_access(dst) do |p|
219
- Bundler.mkdir_p(p)
220
- end
221
- Bundler.sudo "cp -R #{src} #{dst}" if Dir[src].any?
212
+ # SUDO HAX
213
+ if requires_sudo?
214
+ Bundler.rubygems.repository_subdirectories.each do |name|
215
+ src = File.join(install_path, name, "*")
216
+ dst = File.join(rubygems_dir, name)
217
+ if name == "extensions" && Dir.glob(src).any?
218
+ src = File.join(src, "*/*")
219
+ ext_src = Dir.glob(src).first
220
+ ext_src.gsub!(src[0..-6], "")
221
+ dst = File.dirname(File.join(dst, ext_src))
222
222
  end
223
+ SharedHelpers.filesystem_access(dst) do |p|
224
+ Bundler.mkdir_p(p)
225
+ end
226
+ Bundler.sudo "cp -R #{src} #{dst}" if Dir[src].any?
227
+ end
223
228
 
224
- spec.executables.each do |exe|
225
- SharedHelpers.filesystem_access(Bundler.system_bindir) do |p|
226
- Bundler.mkdir_p(p)
227
- end
228
- Bundler.sudo "cp -R #{install_path}/bin/#{exe} #{Bundler.system_bindir}/"
229
+ spec.executables.each do |exe|
230
+ SharedHelpers.filesystem_access(Bundler.system_bindir) do |p|
231
+ Bundler.mkdir_p(p)
229
232
  end
233
+ Bundler.sudo "cp -R #{install_path}/bin/#{exe} #{Bundler.system_bindir}/"
230
234
  end
231
- installed_spec.loaded_from = loaded_from(spec)
232
235
  end
233
- spec.loaded_from = loaded_from(spec)
234
236
 
235
237
  spec.post_install_message
236
238
  ensure
@@ -348,10 +350,6 @@ module Bundler
348
350
  end
349
351
  end
350
352
 
351
- def loaded_from(spec)
352
- "#{rubygems_dir}/specifications/#{spec.full_name}.gemspec"
353
- end
354
-
355
353
  def cached_gem(spec)
356
354
  if spec.default_gem?
357
355
  cached_built_in_gem(spec)
@@ -364,10 +362,14 @@ module Bundler
364
362
  global_cache_path = download_cache_path(spec)
365
363
  @caches << global_cache_path if global_cache_path
366
364
 
367
- possibilities = @caches.map {|p| "#{p}/#{spec.file_name}" }
365
+ possibilities = @caches.map {|p| package_path(p, spec) }
368
366
  possibilities.find {|p| File.exist?(p) }
369
367
  end
370
368
 
369
+ def package_path(cache_path, spec)
370
+ "#{cache_path}/#{spec.file_name}"
371
+ end
372
+
371
373
  def normalize_uri(uri)
372
374
  uri = uri.to_s
373
375
  uri = "#{uri}/" unless uri =~ %r{/$}
@@ -459,12 +461,11 @@ module Bundler
459
461
  end
460
462
 
461
463
  def fetch_gem(spec, previous_spec = nil)
462
- return false unless spec.remote
463
-
464
464
  spec.fetch_platform
465
465
 
466
466
  cache_path = download_cache_path(spec) || default_cache_path_for(rubygems_dir)
467
- gem_path = "#{cache_path}/#{spec.file_name}"
467
+ gem_path = package_path(cache_path, spec)
468
+ return gem_path if File.exist?(gem_path)
468
469
 
469
470
  if requires_sudo?
470
471
  download_path = Bundler.tmp(spec.full_name)
@@ -482,7 +483,7 @@ module Bundler
482
483
  SharedHelpers.filesystem_access(cache_path) do |p|
483
484
  Bundler.mkdir_p(p)
484
485
  end
485
- Bundler.sudo "mv #{download_cache_path}/#{spec.file_name} #{gem_path}"
486
+ Bundler.sudo "mv #{package_path(download_cache_path, spec)} #{gem_path}"
486
487
  end
487
488
 
488
489
  gem_path
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.3.15".freeze
4
+ VERSION = "2.3.16".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
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.3.15
4
+ version: 2.3.16
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: 2022-06-01 00:00:00.000000000 Z
25
+ date: 2022-06-15 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
@@ -369,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
369
369
  - !ruby/object:Gem::Version
370
370
  version: 2.5.2
371
371
  requirements: []
372
- rubygems_version: 3.3.15
372
+ rubygems_version: 3.3.16
373
373
  signing_key:
374
374
  specification_version: 4
375
375
  summary: The best way to manage your application's dependencies