bootsnap 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +13 -0
- data/CHANGELOG.md +8 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/bin/testunit +3 -3
- data/dev.yml +2 -1
- data/lib/bootsnap/compile_cache/iseq.rb +0 -1
- data/lib/bootsnap/explicit_require.rb +6 -1
- data/lib/bootsnap/load_path_cache/cache.rb +9 -11
- data/lib/bootsnap/load_path_cache/core_ext/active_support.rb +11 -13
- data/lib/bootsnap/version.rb +1 -1
- metadata +4 -3
- data/LICENSE +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3e149a8eb8efa3469c157ec2858ccfbe1613a84
|
4
|
+
data.tar.gz: eb7b1180fc432ffd80b88849b7ffe7df50fd409e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc8848fdac6603869affe7f7329bdf3bf691233fd4031d0d4481cee6190623b4d388a6d868bca7d7f49ff9da6bd622f8b98a9056314a344ee980103d2ae2d2dc
|
7
|
+
data.tar.gz: 91326a624801bd3c24053bd789a1157d497c35e44a7c5993f06c11f51eadebf3fed8305195e57e3d8e907415875763c592e6772842692c6155ff0f60d4f6dbf0
|
data/.rubocop.yml
CHANGED
@@ -4,4 +4,17 @@ inherit_from:
|
|
4
4
|
AllCops:
|
5
5
|
Exclude:
|
6
6
|
- 'vendor/**/*'
|
7
|
+
- 'tmp/**/*'
|
8
|
+
TargetRubyVersion: '2.2'
|
7
9
|
|
10
|
+
# This doesn't take into account retrying from an exception
|
11
|
+
Lint/HandleExceptions:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
# allow String.new to create mutable strings
|
15
|
+
Style/EmptyLiteral:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
# allow the use of globals which makes sense in a CLI app like this
|
19
|
+
Style/GlobalVars:
|
20
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at burke@libbey.me. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Shopify, Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/bin/testunit
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
if [ $# -eq 0 ]; then
|
4
|
-
ruby -I"test" -w -e 'Dir.glob("./test/**/*_test.rb").each { |f| require f }' -- "$@"
|
3
|
+
if [[ $# -eq 0 ]]; then
|
4
|
+
exec ruby -I"test" -w -e 'Dir.glob("./test/**/*_test.rb").each { |f| require f }' -- "$@"
|
5
5
|
else
|
6
6
|
path=$1
|
7
|
-
ruby -I"test" -w -e "require '${path#test/}'" -- "$@"
|
7
|
+
exec ruby -I"test" -w -e "require '${path#test/}'" -- "$@"
|
8
8
|
fi
|
data/dev.yml
CHANGED
@@ -23,24 +23,21 @@ module Bootsnap
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# { 'enumerator' => nil, 'enumerator.so' => nil, ... }
|
26
|
-
BUILTIN_FEATURES = $LOADED_FEATURES.
|
26
|
+
BUILTIN_FEATURES = $LOADED_FEATURES.each_with_object({}) do |feat, features|
|
27
27
|
# Builtin features are of the form 'enumerator.so'.
|
28
28
|
# All others include paths.
|
29
|
-
next
|
29
|
+
next unless feat.size < 20 && !feat.include?('/')
|
30
30
|
|
31
31
|
base = File.basename(feat, '.*') # enumerator.so -> enumerator
|
32
32
|
ext = File.extname(feat) # .so
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
features[feat] = nil # enumerator.so
|
35
|
+
features[base] = nil # enumerator
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
37
|
+
next unless [DOT_SO, *DL_EXTENSIONS].include?(ext)
|
38
|
+
DL_EXTENSIONS.each do |dl_ext|
|
39
|
+
features["#{base}#{dl_ext}"] = nil # enumerator.bundle
|
41
40
|
end
|
42
|
-
|
43
|
-
acc
|
44
41
|
end.freeze
|
45
42
|
|
46
43
|
# Try to resolve this feature to an absolute path without traversing the
|
@@ -67,7 +64,8 @@ module Bootsnap
|
|
67
64
|
# If the extension was one of the ones we explicitly cache (.rb and the
|
68
65
|
# native dynamic extension, e.g. .bundle or .so), we know it was a
|
69
66
|
# failure and there's nothing more we can do to find the file.
|
70
|
-
|
67
|
+
# no extension, .rb, (.bundle or .so)
|
68
|
+
when '', *CACHED_EXTENSIONS # rubocop:disable Performance/CaseWhenSplat
|
71
69
|
nil
|
72
70
|
# Ruby allows specifying native extensions as '.so' even when DLEXT
|
73
71
|
# is '.bundle'. This is where we handle that case.
|
@@ -2,15 +2,6 @@ module Bootsnap
|
|
2
2
|
module LoadPathCache
|
3
3
|
module CoreExt
|
4
4
|
module ActiveSupport
|
5
|
-
def self.with_bootsnap_fallback(error)
|
6
|
-
yield
|
7
|
-
rescue error => e
|
8
|
-
# NoMethodError is a NameError, but we only want to handle actual
|
9
|
-
# NameError instances.
|
10
|
-
raise unless e.class == error
|
11
|
-
without_bootsnap_cache { yield }
|
12
|
-
end
|
13
|
-
|
14
5
|
def self.without_bootsnap_cache
|
15
6
|
prev = Thread.current[:without_bootsnap_cache] || false
|
16
7
|
Thread.current[:without_bootsnap_cache] = true
|
@@ -21,9 +12,8 @@ module Bootsnap
|
|
21
12
|
|
22
13
|
module ClassMethods
|
23
14
|
def autoload_paths=(o)
|
24
|
-
|
15
|
+
super
|
25
16
|
Bootsnap::LoadPathCache.autoload_paths_cache.reinitialize(o)
|
26
|
-
r
|
27
17
|
end
|
28
18
|
|
29
19
|
def search_for_file(path)
|
@@ -50,13 +40,21 @@ module Bootsnap
|
|
50
40
|
# behaviour. The gymnastics here are a bit awkward, but it prevents
|
51
41
|
# 200+ lines of monkeypatches.
|
52
42
|
def load_missing_constant(from_mod, const_name)
|
53
|
-
|
43
|
+
super
|
44
|
+
rescue NameError => e
|
45
|
+
# NoMethodError is a NameError, but we only want to handle actual
|
46
|
+
# NameError instances.
|
47
|
+
raise unless e.class == NameError
|
48
|
+
raise if from_mod.const_defined?(const_name)
|
49
|
+
CoreExt::ActiveSupport.without_bootsnap_cache { super }
|
54
50
|
end
|
55
51
|
|
56
52
|
# Signature has changed a few times over the years; easiest to not
|
57
53
|
# reiterate it with version polymorphism here...
|
58
54
|
def depend_on(*)
|
59
|
-
|
55
|
+
super
|
56
|
+
rescue LoadError
|
57
|
+
CoreExt::ActiveSupport.without_bootsnap_cache { super }
|
60
58
|
end
|
61
59
|
end
|
62
60
|
end
|
data/lib/bootsnap/version.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,9 +106,10 @@ files:
|
|
106
106
|
- ".rubocop.yml"
|
107
107
|
- ".travis.yml"
|
108
108
|
- CHANGELOG.md
|
109
|
+
- CODE_OF_CONDUCT.md
|
109
110
|
- CONTRIBUTING.md
|
110
111
|
- Gemfile
|
111
|
-
- LICENSE
|
112
|
+
- LICENSE.txt
|
112
113
|
- README.md
|
113
114
|
- Rakefile
|
114
115
|
- bin/console
|
data/LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2017 Shopify
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|