bootsnap 1.4.2.rc1 → 1.4.2.rc2

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: 1b7e391a76fc9fe8cc2c712d7623f26e6138f24c62acd3cd16a470f50812e554
4
- data.tar.gz: 23d068050fd8c1962915608e73418c01dc568cc5371a5d27f77a269ef2926aeb
3
+ metadata.gz: 83f911740073d58a217017c1aa526fa41271cb7829ef762784cbd31f613a27e9
4
+ data.tar.gz: 359820887978e6aebd27dbad8cf393ab094f75f4e9239a5f7309b5306c397525
5
5
  SHA512:
6
- metadata.gz: 815c87a26099673845b530d5a0bb2000ceda89f15a17eeca178b087d3ae4af6230ce8dcaa15a4360a2fdb0fc8d923d0659dc47ac6a7d2b072d43eebadeaebc79
7
- data.tar.gz: 46584a5b22e3a64a02302a3ea87dfbe6e99676935838560ec93f938a0c3b86e854aacd48364e4f7161c021d5472497844b3d81074e1a3cc1be82a2aac3bee158
6
+ metadata.gz: 49887a724d7f10bb2ca630dbd971df3d50f7f71fedc41f86b0cca5dc36af30b7654a38fada0b4cbe5fdbc78a1271d66e3c30ade756f1383d1620274c07398346
7
+ data.tar.gz: 0d446eab9cd2143160fe0f05f90a326c1fbbbd54af675a9ee4430e85784e44ff6680af3c62142924c68278c8d2a70f03fe1d39d931bcf5e093a9a91132755e35
@@ -7,6 +7,11 @@ module Bootsnap
7
7
  DOT_SO = '.so'
8
8
  SLASH = '/'
9
9
 
10
+ # If a NameError happens several levels deep, don't re-handle it
11
+ # all the way up the chain: mark it once and bubble it up without
12
+ # more retries.
13
+ ERROR_TAG_IVAR = :@__bootsnap_rescued
14
+
10
15
  DL_EXTENSIONS = ::RbConfig::CONFIG
11
16
  .values_at('DLEXT', 'DLEXT2')
12
17
  .reject { |ext| !ext || ext.empty? }
@@ -18,11 +18,6 @@ module Bootsnap
18
18
  Thread.current[:without_bootsnap_retry] = prev
19
19
  end
20
20
 
21
- # If a NameError happens several levels deep, don't re-handle it
22
- # all the way up the chain: mark it once and bubble it up without
23
- # more retries.
24
- ERROR_TAG_IVAR = :@__bootsnap_rescued
25
-
26
21
  module ClassMethods
27
22
  def autoload_paths=(o)
28
23
  super
@@ -65,8 +60,8 @@ module Bootsnap
65
60
  super
66
61
  end
67
62
  rescue NameError => e
68
- raise(e) if e.instance_variable_defined?(ERROR_TAG_IVAR)
69
- e.instance_variable_set(ERROR_TAG_IVAR, true)
63
+ raise(e) if e.instance_variable_defined?(Bootsnap::LoadPathCache::ERROR_TAG_IVAR)
64
+ e.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
70
65
 
71
66
  # This function can end up called recursively, we only want to
72
67
  # retry at the top-level.
@@ -89,8 +84,8 @@ module Bootsnap
89
84
  def depend_on(*)
90
85
  super
91
86
  rescue LoadError => e
92
- raise(e) if e.instance_variable_defined?(ERROR_TAG_IVAR)
93
- e.instance_variable_set(ERROR_TAG_IVAR, true)
87
+ raise(e) if e.instance_variable_defined?(Bootsnap::LoadPathCache::ERROR_TAG_IVAR)
88
+ e.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
94
89
 
95
90
  # If we already had cache disabled, there's no use retrying
96
91
  raise(e) if Thread.current[:without_bootsnap_cache]
@@ -3,6 +3,7 @@ module Bootsnap
3
3
  module CoreExt
4
4
  def self.make_load_error(path)
5
5
  err = LoadError.new("cannot load such file -- #{path}")
6
+ err.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
6
7
  err.define_singleton_method(:path) { path }
7
8
  err
8
9
  end
@@ -30,6 +31,9 @@ module Kernel
30
31
  end
31
32
 
32
33
  raise(Bootsnap::LoadPathCache::CoreExt.make_load_error(path))
34
+ rescue LoadError => e
35
+ e.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
36
+ raise(e)
33
37
  rescue Bootsnap::LoadPathCache::ReturnFalse
34
38
  false
35
39
  rescue Bootsnap::LoadPathCache::FallbackScan
@@ -56,6 +60,9 @@ module Kernel
56
60
  end
57
61
 
58
62
  raise(Bootsnap::LoadPathCache::CoreExt.make_load_error(path))
63
+ rescue LoadError => e
64
+ e.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
65
+ raise(e)
59
66
  rescue Bootsnap::LoadPathCache::ReturnFalse
60
67
  false
61
68
  rescue Bootsnap::LoadPathCache::FallbackScan
@@ -74,6 +81,9 @@ class Module
74
81
  # added to $LOADED_FEATURES and won't be able to hook that modification
75
82
  # since it's done in C-land.
76
83
  autoload_without_bootsnap(const, Bootsnap::LoadPathCache.load_path_cache.find(path) || path)
84
+ rescue LoadError => e
85
+ e.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
86
+ raise(e)
77
87
  rescue Bootsnap::LoadPathCache::ReturnFalse
78
88
  false
79
89
  rescue Bootsnap::LoadPathCache::FallbackScan
@@ -1,3 +1,3 @@
1
1
  module Bootsnap
2
- VERSION = "1.4.2.rc1"
2
+ VERSION = "1.4.2.rc2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2.rc1
4
+ version: 1.4.2.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey