bundler-multilock 1.0.7 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 120fec48596049892548e831194ad633d30c88048f4dc333ca70be729fb1aee1
4
- data.tar.gz: 1cc4f39d08b2c99cf608cbe0221f41702f0deaeecf661ecefb61b7e4d9204f14
3
+ metadata.gz: c3c22d18b37d9d24220bfd86fa998d94cf5a1369252150b17d579b1921c2a7ff
4
+ data.tar.gz: 571095e3e063925db5afd3403c401d3c38eb598b2da0af7d7fe09b613b5a2686
5
5
  SHA512:
6
- metadata.gz: 01e41aee6dc834bacab9aa4f7006f1fbdaa07ac880b3e1fb97598b3fa116c74d6d8f4179c117ceddac8e617f9ff354417df95eb4c058912a6f0e9e6dc1bc8320
7
- data.tar.gz: fe4619b9a9e9a890310e6fc748b0d2b6581471f6e463d1d76cf9aa84a040177d622546d47e1f6820f3b0087ed9e737af77c8062f59b451ee5f4fcc8cb10fd6d9
6
+ metadata.gz: 8088c2a27858e008353eea944d3ed0c803433a2b5c3b71ee1f3e4e694624d9deebb54d0dc4b8af29241eb77fb59abb158191c3077b9eb261813228627930285c
7
+ data.tar.gz: a4ec23e48dba110e68773b170998f3c334a7adf117e8bd6a3a6c5485414901073006d76d07a48ebd7d8dfc20cb2a93ef4e8112e465dd4a21279a827ba4c03928
@@ -56,10 +56,7 @@ module Bundler
56
56
 
57
57
  begin
58
58
  definition.validate_runtime!
59
- Bundler.ui.silence do
60
- definition.resolve_only_locally!
61
- end
62
- not_installed = definition.missing_specs
59
+ not_installed = Bundler.ui.silence { definition.missing_specs }
63
60
  rescue RubyVersionMismatch, GemNotFound, SolveFailure
64
61
  return return_missing ? [] : false
65
62
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bundler
4
4
  module Multilock
5
- VERSION = "1.0.7"
5
+ VERSION = "1.0.9"
6
6
  end
7
7
  end
@@ -48,17 +48,15 @@ module Bundler
48
48
  current = true if current.nil? && lockfile_definitions.empty? && lockfile.nil? && gemfile.nil?
49
49
 
50
50
  # allow short-form lockfile names
51
- lockfile = "Gemfile.#{lockfile}.lock" if lockfile && !(lockfile.include?("/") || lockfile.end_with?(".lock"))
51
+ if lockfile.is_a?(String) && !(lockfile.include?("/") || lockfile.end_with?(".lock"))
52
+ lockfile = "Gemfile.#{lockfile}.lock"
53
+ end
52
54
  # if a gemfile was provided, but not a lockfile, infer the default lockfile for that gemfile
53
55
  lockfile ||= "#{gemfile}.lock" if gemfile
54
56
  # use absolute paths
55
57
  lockfile = Bundler.root.join(lockfile).expand_path if lockfile
56
58
  # use the default lockfile (Gemfile.lock) if none was given
57
59
  lockfile ||= Bundler.default_lockfile(force_original: true)
58
- if current && (old_current = lockfile_definitions.find { |definition| definition[:current] })
59
- raise ArgumentError, "Only one lockfile (#{old_current[:lockfile]}) can be flagged as the default"
60
- end
61
-
62
60
  raise ArgumentError, "Lockfile #{lockfile} is already defined" if lockfile_definitions.any? do |definition|
63
61
  definition[:lockfile] == lockfile
64
62
  end
@@ -72,6 +70,10 @@ module Bundler
72
70
  current = env_lockfile == lockfile
73
71
  end
74
72
 
73
+ if current && (old_current = lockfile_definitions.find { |definition| definition[:current] })
74
+ raise ArgumentError, "Only one lockfile (#{old_current[:lockfile]}) can be flagged as the default"
75
+ end
76
+
75
77
  lockfile_definitions << (lockfile_def = {
76
78
  gemfile: (gemfile && Bundler.root.join(gemfile).expand_path) || Bundler.default_gemfile,
77
79
  lockfile: lockfile,
@@ -339,8 +341,13 @@ module Bundler
339
341
  end
340
342
  end
341
343
 
342
- modified = inject_specific_preamble(gemfile, injection_point, bundle_preamble2, add_newline: true)
344
+ builder = Bundler::Plugin::DSL.new
345
+ builder.eval_gemfile(Bundler.default_gemfile)
346
+ gemfiles = builder.instance_variable_get(:@gemfiles).map(&:read)
347
+
348
+ modified = inject_specific_preamble(gemfile, gemfiles, injection_point, bundle_preamble2, add_newline: true)
343
349
  modified = true if inject_specific_preamble(gemfile,
350
+ gemfiles,
344
351
  injection_point,
345
352
  bundle_preamble1,
346
353
  match: bundle_preamble1_match,
@@ -357,8 +364,8 @@ module Bundler
357
364
 
358
365
  private
359
366
 
360
- def inject_specific_preamble(gemfile, injection_point, preamble, add_newline:, match: preamble)
361
- return false if gemfile.include?(match)
367
+ def inject_specific_preamble(gemfile, gemfiles, injection_point, preamble, add_newline:, match: preamble)
368
+ return false if gemfiles.any? { |g| g.include?(match) }
362
369
 
363
370
  add_newline = false unless gemfile[injection_point - 1] == "\n"
364
371
 
@@ -388,7 +395,6 @@ module Bundler
388
395
  if install
389
396
  current_definition = builder.to_definition(current_lockfile, {})
390
397
  begin
391
- current_definition.resolve_only_locally!
392
398
  if current_definition.missing_specs.any?
393
399
  Bundler.with_default_lockfile(current_lockfile) do
394
400
  Installer.install(gemfile.dirname, current_definition, {})
@@ -435,3 +441,5 @@ module Bundler
435
441
  @prepare_block = nil
436
442
  end
437
443
  end
444
+
445
+ Bundler::Multilock.inject_preamble unless Bundler::Multilock.loaded?
data/plugins.rb CHANGED
@@ -46,5 +46,3 @@ end
46
46
  Bundler::Plugin.add_hook(Bundler::Plugin::Events::GEM_AFTER_INSTALL_ALL) do |_|
47
47
  Bundler::Multilock.after_install_all
48
48
  end
49
-
50
- Bundler::Multilock.inject_preamble unless Bundler::Multilock.loaded?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-multilock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-18 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler