bootsnap 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bootsnap/load_path_cache/cache.rb +8 -10
- data/lib/bootsnap/version.rb +1 -1
- 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: 9899f0b2bee1a4e655277b00c7e31aa9b9bb11de
|
4
|
+
data.tar.gz: 10d657b77486731b2dc6cb0c21b6b9cd59dcb021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 345a4bf40d80ca9b04d03a8c5088758f59dddf6ff8272637bc6cd247f8047ee4dfbccf9ff2d6866d6220361c110d60d6ba08addb76a43e6d7fd36f04fb643c5a
|
7
|
+
data.tar.gz: 5ec8b6b63ef27265355d6ff879c710d3720a3fb7671e78e07326ddaeca7d77af800ddc86e13ddc4c1079449e9bbc79d7fedf1efe4a76c68dab6453f041d5fbac
|
@@ -54,22 +54,20 @@ module Bootsnap
|
|
54
54
|
x = search_index(feature)
|
55
55
|
return x if x
|
56
56
|
|
57
|
+
# Ruby has some built-in features that require lies about.
|
58
|
+
# For example, 'enumerator' is built in. If you require it, ruby
|
59
|
+
# returns false as if it were already loaded; however, there is no
|
60
|
+
# file to find on disk. We've pre-built a list of these, and we
|
61
|
+
# return false if any of them is loaded.
|
62
|
+
raise LoadPathCache::ReturnFalse if BUILTIN_FEATURES.key?(feature)
|
63
|
+
|
57
64
|
# The feature wasn't found on our preliminary search through the index.
|
58
65
|
# We resolve this differently depending on what the extension was.
|
59
66
|
case File.extname(feature)
|
60
67
|
# If the extension was one of the ones we explicitly cache (.rb and the
|
61
68
|
# native dynamic extension, e.g. .bundle or .so), we know it was a
|
62
69
|
# failure and there's nothing more we can do to find the file.
|
63
|
-
when *CACHED_EXTENSIONS # .rb, .bundle or .so
|
64
|
-
nil
|
65
|
-
# If no extension was specified, it's the same situation, since we
|
66
|
-
# try appending both cachable extensions in search_index. However,
|
67
|
-
# there's a special-case for 'enumerator'. Before ruby 1.9, you had
|
68
|
-
# to `require 'enumerator'` to use it. In 1.9+, it's pre-loaded, but
|
69
|
-
# doesn't correspond to any entry on the filesystem. Ruby lies. So we
|
70
|
-
# lie too, forcing our monkeypatch to return false like ruby would.
|
71
|
-
when ""
|
72
|
-
raise LoadPathCache::ReturnFalse if BUILTIN_FEATURES.key?(feature)
|
70
|
+
when '', *CACHED_EXTENSIONS # no extension, .rb, (.bundle or .so)
|
73
71
|
nil
|
74
72
|
# Ruby allows specifying native extensions as '.so' even when DLEXT
|
75
73
|
# is '.bundle'. This is where we handle that case.
|
data/lib/bootsnap/version.rb
CHANGED