bootsnap 1.4.2.rc2 → 1.4.2.rc3

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: 83f911740073d58a217017c1aa526fa41271cb7829ef762784cbd31f613a27e9
4
- data.tar.gz: 359820887978e6aebd27dbad8cf393ab094f75f4e9239a5f7309b5306c397525
3
+ metadata.gz: 38681b872206424d8c9f64e06dcc814feeec7bd252dd987e2b6c9a09a52ab429
4
+ data.tar.gz: 74d5f5c18d506c5f78ccd33e35dd900a484f41305f955eb9d37499d4c35ca3d0
5
5
  SHA512:
6
- metadata.gz: 49887a724d7f10bb2ca630dbd971df3d50f7f71fedc41f86b0cca5dc36af30b7654a38fada0b4cbe5fdbc78a1271d66e3c30ade756f1383d1620274c07398346
7
- data.tar.gz: 0d446eab9cd2143160fe0f05f90a326c1fbbbd54af675a9ee4430e85784e44ff6680af3c62142924c68278c8d2a70f03fe1d39d931bcf5e093a9a91132755e35
6
+ metadata.gz: 77dc9d0295427aebda3e638c727fac900b2b05babafc73333f6ed30f3a762b1bbff3fdf115baaabc694ab650924a14282bd1920cb0ddab41bfb1c77d4eb3732c
7
+ data.tar.gz: 07b6b5b65b46aef24bd2ef1d558d774aafa41d09fb6a11b84ca57772d2f6dce81a0cca1df3f11e9e45981986efcbf392b903fd50168ff571a29d8b10eb98084d
data/README.md CHANGED
@@ -33,6 +33,10 @@ Note that bootsnap writes to `tmp/cache`, and that directory *must* be writable.
33
33
  boot if it is not. If this is unacceptable (e.g. you are running in a read-only container and
34
34
  unwilling to mount in a writable tmpdir), you should remove this line or wrap it in a conditional.
35
35
 
36
+ **Note also that bootsnap will never clean up its own cache: this is left up to you. Depending on your
37
+ deployment strategy, you may need to periodically purge `tmp/cache/bootsnap*`. If you notice deploys
38
+ getting progressively slower, this is almost certainly the cause.**
39
+
36
40
  It's technically possible to simply specify `gem 'bootsnap', require: 'bootsnap/setup'`, but it's
37
41
  important to load Bootsnap as early as possible to get maximum performance improvement.
38
42
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bootsnap
2
4
  module LoadPathCache
3
5
  ReturnFalse = Class.new(StandardError)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative('../explicit_require')
2
4
 
3
5
  module Bootsnap
@@ -4,4 +4,14 @@ class << $LOADED_FEATURES
4
4
  Bootsnap::LoadPathCache.loaded_features_index.purge(key)
5
5
  delete_without_bootsnap(key)
6
6
  end
7
+
8
+ alias_method(:reject_without_bootsnap!, :reject!)
9
+ def reject!(&block)
10
+ backup = dup
11
+
12
+ # FIXME: if no block is passed we'd need to return a decorated iterator
13
+ reject_without_bootsnap!(&block)
14
+
15
+ Bootsnap::LoadPathCache.loaded_features_index.purge_multi(backup - self)
16
+ end
7
17
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bootsnap
2
4
  module LoadPathCache
3
5
  # LoadedFeaturesIndex partially mirrors an internal structure in ruby that
@@ -55,6 +57,13 @@ module Bootsnap
55
57
  end
56
58
  end
57
59
 
60
+ def purge_multi(features)
61
+ rejected_hashes = features.map(&:hash).to_set
62
+ @mutex.synchronize do
63
+ @lfi.reject! { |_, hash| rejected_hashes.include?(hash) }
64
+ end
65
+ end
66
+
58
67
  def key?(feature)
59
68
  @mutex.synchronize { @lfi.key?(feature) }
60
69
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative('../explicit_require')
2
4
 
3
5
  module Bootsnap
@@ -11,7 +13,7 @@ module Bootsnap
11
13
  BUNDLE_PATH = if Bootsnap.bundler?
12
14
  (Bundler.bundle_path.cleanpath.to_s << LoadPathCache::SLASH).freeze
13
15
  else
14
- ''.freeze
16
+ ''
15
17
  end
16
18
 
17
19
  def self.call(path)
@@ -1,3 +1,3 @@
1
1
  module Bootsnap
2
- VERSION = "1.4.2.rc2"
2
+ VERSION = "1.4.2.rc3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2.rc2
4
+ version: 1.4.2.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -167,7 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  - !ruby/object:Gem::Version
168
168
  version: 1.3.1
169
169
  requirements: []
170
- rubygems_version: 3.0.2
170
+ rubyforge_project:
171
+ rubygems_version: 2.7.6
171
172
  signing_key:
172
173
  specification_version: 4
173
174
  summary: Boot large ruby/rails apps faster