bundler-multilock 1.0.7 → 1.0.9
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 +4 -4
- data/lib/bundler/multilock/check.rb +1 -4
- data/lib/bundler/multilock/version.rb +1 -1
- data/lib/bundler/multilock.rb +17 -9
- data/plugins.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3c22d18b37d9d24220bfd86fa998d94cf5a1369252150b17d579b1921c2a7ff
|
4
|
+
data.tar.gz: 571095e3e063925db5afd3403c401d3c38eb598b2da0af7d7fe09b613b5a2686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/bundler/multilock.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
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
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.
|
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-
|
11
|
+
date: 2023-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|