bundler-multilock 2.0.0.beta2 → 2.0.0.beta4

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: 9f460b4a8e3a313b8104bc1573ae8dc6ce7a3fd4f27e95d7f6c44ce0b9c04503
4
- data.tar.gz: fd32c498cfcbcd5a93c493bf3540badf1395198c55e6417c25149660035984dc
3
+ metadata.gz: 45718b8a0410e25b206212808dd21eb5530561297393c3f6fca54a14acd26e40
4
+ data.tar.gz: 35245c2fc0f936995c0cbc5be482bf20dc6767de70cc23b41fe1b89b63e179cd
5
5
  SHA512:
6
- metadata.gz: c81aa670f50a10bc6af541cd86abe681c34568725a102a46fadccfc94ffa857e36f977bc4c2a4c1e96f95826f1a62f26b4f84948b719edf1e2e788112aa6a770
7
- data.tar.gz: 178a9364a8ccd977a908446694db6b4676ae27ce31304de60613eba72791e835bf3571e616dda95454197d3a52e702bd4f23942562c5bc87f42328547252019e
6
+ metadata.gz: 2e069c0c770748ebdfe957fc1c795553ecaa7afdd7655a180e5c6ced84f0e31840bd7f9233dcd6d07b70ac765fbde244624b1976a15f2d5dc31adb1e1accadaf
7
+ data.tar.gz: c70adec856e83bb4520d3705e714bd2d1e99672d8c866faf1718928d65c1b3062b004c242e353037f7d7a0b35ea7bfb0675b2af20afd64416c1f8a14d03c7421
@@ -38,6 +38,16 @@ module Bundler
38
38
  def locked_checksums
39
39
  checksums
40
40
  end
41
+
42
+ # Bundler 4.1 asks the definition about the lockfile it's replacing;
43
+ # here the adapted lockfile is both the old and the new one.
44
+ def locked_gems
45
+ __getobj__
46
+ end
47
+
48
+ def bundler_version_to_lock
49
+ bundler_version
50
+ end
41
51
  end
42
52
 
43
53
  private_constant :LockfileAdapter
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bundler
4
4
  module Multilock
5
- VERSION = "2.0.0.beta2"
5
+ VERSION = "2.0.0.beta4"
6
6
  end
7
7
  end
@@ -184,7 +184,12 @@ module Bundler
184
184
  next
185
185
  end
186
186
 
187
- if Bundler.frozen_bundle?
187
+ # a missing lockfile that enforces pinned additional dependencies has nothing
188
+ # to be out of sync with, so even a frozen bundle just generates it
189
+ generate_missing = Bundler.frozen_bundle? && !lockfile_name.exist? &&
190
+ lockfile_definition[:enforce_pinned_additional_dependencies]
191
+
192
+ if Bundler.frozen_bundle? && !generate_missing
188
193
  # if we're frozen, you have to use the pre-existing lockfile
189
194
  unless lockfile_name.exist?
190
195
  Bundler.ui.error("The bundle is locked, but #{relative_lockfile} is missing. " \
@@ -294,12 +299,16 @@ module Bundler
294
299
  temp_lockfile.write(new_contents)
295
300
  temp_lockfile.flush
296
301
 
297
- had_changes ||= write_lockfile(lockfile_definition,
298
- temp_lockfile.path,
299
- cache,
300
- install:,
301
- dependency_changes:,
302
- unlocking_bundler:)
302
+ # Bundler refuses to write a lockfile when frozen, which we need to allow in the case
303
+ # of a missing lockfile that enforces pinned dependencies.
304
+ Bundler.settings.temporary(frozen: generate_missing ? false : Bundler.frozen_bundle?) do
305
+ had_changes ||= write_lockfile(lockfile_definition,
306
+ temp_lockfile.path,
307
+ cache,
308
+ install:,
309
+ dependency_changes:,
310
+ unlocking_bundler:)
311
+ end
303
312
  end
304
313
  cache.invalidate_lockfile(lockfile_name) if had_changes
305
314
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-multilock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta2
4
+ version: 2.0.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure