lock_jar 0.14.3 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lock_jar/bundler.rb +16 -2
- data/lib/lock_jar/version.rb +1 -1
- data/spec/lock_jar/bundler_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4ea5120a753aae9eb91e96f329fbcae0c92e9c3
|
4
|
+
data.tar.gz: 61472dda7102182b9b89585b682d32b26c47063a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b655a750d8c9144d72d51e7239028a3a7aa62f90434a03199099fd1a68cea9bf57286ba26d536fb50dc2907132a186ea162339da97ee4e9a2f51131188f33b33
|
7
|
+
data.tar.gz: 52d4ce70c69ff71dc80fef77cf2fc4b864a8ed55809423bdbafdb74b151c117bd0a2db1ad6e50bed6fac1afd1a7163d8af6d5bbf44254e827b9a54e09a375f32
|
data/lib/lock_jar/bundler.rb
CHANGED
@@ -10,18 +10,32 @@ module LockJar
|
|
10
10
|
#
|
11
11
|
class Bundler
|
12
12
|
class << self
|
13
|
+
attr_accessor :skip_lock
|
14
|
+
|
13
15
|
# Patch Bundler::Definition.to_lock to run LockJar::Bundler.lock!
|
14
16
|
def lock_with_bundler(*opts)
|
17
|
+
next if @lock_with_bundler_patched
|
18
|
+
|
15
19
|
::Bundler::Definition.class_eval do
|
16
20
|
alias_method :_lockjar_extended_to_lock, :to_lock
|
17
|
-
define_method(:to_lock) do
|
21
|
+
define_method(:to_lock) do |*args|
|
18
22
|
result = _lockjar_extended_to_lock
|
19
23
|
|
20
|
-
LockJar::Bundler.lock!(opts)
|
24
|
+
LockJar::Bundler.lock!(opts) unless LockJar::Bundler.skip_lock
|
21
25
|
|
22
26
|
result
|
23
27
|
end
|
24
28
|
end
|
29
|
+
|
30
|
+
::Bundler::Runtime.class_eval do
|
31
|
+
alias_method :_lockjar_extended_setup, :setup
|
32
|
+
define_method(:setup) do |*groups|
|
33
|
+
LockJar::Bundler.skip_lock = true
|
34
|
+
_lockjar_extended_setup
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
@lock_with_bundler_patched = true
|
25
39
|
end
|
26
40
|
|
27
41
|
# Create a lock file from bundled gems
|
data/lib/lock_jar/version.rb
CHANGED
@@ -23,5 +23,13 @@ describe LockJar::Bundler do
|
|
23
23
|
expect(LockJar::Bundler).to receive(:lock!).with([{ test: :arg }])
|
24
24
|
::Bundler::CLI::Install.new({}).run
|
25
25
|
end
|
26
|
+
|
27
|
+
context 'with Bundler.setup' do
|
28
|
+
it 'should not call lock!' do
|
29
|
+
LockJar::Bundler.lock_with_bundler(test: :arg)
|
30
|
+
expect(LockJar::Bundler).to_not receive(:lock!).with([{ test: :arg }])
|
31
|
+
::Bundler::setup
|
32
|
+
end
|
33
|
+
end
|
26
34
|
end
|
27
35
|
end
|