lock_jar 0.14.3 → 0.14.4

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
  SHA1:
3
- metadata.gz: 795a7aedb78dcc0d8913b25fb263617d4018e707
4
- data.tar.gz: f09a029a84c9a0123292473cde5110ec502299c9
3
+ metadata.gz: a4ea5120a753aae9eb91e96f329fbcae0c92e9c3
4
+ data.tar.gz: 61472dda7102182b9b89585b682d32b26c47063a
5
5
  SHA512:
6
- metadata.gz: 833e4bda38e0332690a916ea0641463f589ccab70a245f0f4bf56e2757ae15fe604f8757463d94238cb3f63703ba3f8f2d1398ac3841f9d04d25376ab37e8fb1
7
- data.tar.gz: 09b4ca6624b2f03b173309d2dd2e630e1f744b29050163671e6db0ab1a2e137b6788779df2fd4063ecb9da35d5ad6d95b554a6fb2cccc4ce2fc3dc70d917577f
6
+ metadata.gz: b655a750d8c9144d72d51e7239028a3a7aa62f90434a03199099fd1a68cea9bf57286ba26d536fb50dc2907132a186ea162339da97ee4e9a2f51131188f33b33
7
+ data.tar.gz: 52d4ce70c69ff71dc80fef77cf2fc4b864a8ed55809423bdbafdb74b151c117bd0a2db1ad6e50bed6fac1afd1a7163d8af6d5bbf44254e827b9a54e09a375f32
@@ -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
@@ -1,4 +1,4 @@
1
1
  # the version
2
2
  module LockJar
3
- VERSION = '0.14.3'
3
+ VERSION = '0.14.4'
4
4
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lock_jar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Guymon