bootsnap 1.1.2-java → 1.1.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/bin/testunit +2 -2
- data/bootsnap.gemspec +2 -2
- data/lib/bootsnap/load_path_cache/cache.rb +4 -4
- data/lib/bootsnap/load_path_cache/path_scanner.rb +14 -5
- data/lib/bootsnap/load_path_cache/store.rb +2 -0
- data/lib/bootsnap/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e5ced86d8f4b8e5cd77fd68bc776e0023d9486d
|
4
|
+
data.tar.gz: 8e75434679474db2f1c3883495679ba11ad87a1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edc9608549f1e313b4c3bdc6fc788eb055918628116caa1ec3c397de5a3a7ed0cc97aa59b83a493553acce302dae5c44b23582138ec369584ad04288b60c332a
|
7
|
+
data.tar.gz: b4b93d00b10ef0471fe056b068e97c8bb4295b0ce6c8091a5a8cf5d25c988cd2e23f9bc900fbcb12a4d639c8cd48cb34c3ea5c1e7284862dd5c7eec547bab811
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -132,7 +132,7 @@ result too, raising a `LoadError` without touching the filesystem at all.
|
|
132
132
|
|
133
133
|
Ruby has complex grammar and parsing it is not a particularly cheap operation. Since 1.9, Ruby has
|
134
134
|
translated ruby source to an internal bytecode format, which is then executed by the Ruby VM. Since
|
135
|
-
2.
|
135
|
+
2.3.0, Ruby [exposes an API](https://ruby-doc.org/core-2.3.0/RubyVM/InstructionSequence.html) that
|
136
136
|
allows caching that bytecode. This allows us to bypass the relatively-expensive compilation step on
|
137
137
|
subsequent loads of the same file.
|
138
138
|
|
data/bin/testunit
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
3
|
if [ $# -eq 0 ]; then
|
4
|
-
ruby -I"test" -e 'Dir.glob("./test/**/*_test.rb").each { |f| require f }' -- "$@"
|
4
|
+
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" -e "require '${path#test/}'" -- "$@"
|
7
|
+
ruby -I"test" -w -e "require '${path#test/}'" -- "$@"
|
8
8
|
fi
|
data/bootsnap.gemspec
CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.license = "MIT"
|
13
13
|
|
14
|
-
spec.summary = "
|
15
|
-
spec.description =
|
14
|
+
spec.summary = "Boot large ruby/rails apps faster"
|
15
|
+
spec.description = spec.summary
|
16
16
|
spec.homepage = "https://github.com/Shopify/bootsnap"
|
17
17
|
|
18
18
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require_relative '../load_path_cache'
|
2
1
|
require_relative '../explicit_require'
|
3
2
|
|
4
3
|
module Bootsnap
|
@@ -11,6 +10,7 @@ module Bootsnap
|
|
11
10
|
@store = store
|
12
11
|
@mutex = defined?(::Mutex) ? ::Mutex.new : ::Thread::Mutex.new # TODO: Remove once Ruby 2.2 support is dropped.
|
13
12
|
@path_obj = path_obj
|
13
|
+
@has_relative_paths = nil
|
14
14
|
reinitialize
|
15
15
|
end
|
16
16
|
|
@@ -35,8 +35,8 @@ module Bootsnap
|
|
35
35
|
acc[base] = nil # enumerator
|
36
36
|
|
37
37
|
if [DOT_SO, *DL_EXTENSIONS].include?(ext)
|
38
|
-
DL_EXTENSIONS.each do |
|
39
|
-
acc["#{base}#{
|
38
|
+
DL_EXTENSIONS.each do |dl_ext|
|
39
|
+
acc["#{base}#{dl_ext}"] = nil # enumerator.bundle
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -152,7 +152,7 @@ module Bootsnap
|
|
152
152
|
|
153
153
|
def unshift_paths_locked(*paths)
|
154
154
|
@store.transaction do
|
155
|
-
paths.map(&:to_s).
|
155
|
+
paths.map(&:to_s).reverse_each do |path|
|
156
156
|
p = Path.new(path)
|
157
157
|
next if p.non_directory?
|
158
158
|
entries, dirs = p.entries_and_dirs(@store)
|
@@ -1,10 +1,18 @@
|
|
1
|
-
require_relative '../
|
1
|
+
require_relative '../explicit_require'
|
2
2
|
|
3
3
|
module Bootsnap
|
4
4
|
module LoadPathCache
|
5
5
|
module PathScanner
|
6
|
-
|
7
|
-
|
6
|
+
# Glob pattern to find requirable files and subdirectories in given path.
|
7
|
+
# It expands to:
|
8
|
+
#
|
9
|
+
# * `/*{.rb,.so,/}` - It matches requirable files, directories and
|
10
|
+
# symlinks to directories at given path.
|
11
|
+
# * `/*/**/*{.rb,.so,/}` - It matches requirable files and
|
12
|
+
# subdirectories in any (even symlinked) directory at given path at
|
13
|
+
# any directory tree depth.
|
14
|
+
#
|
15
|
+
REQUIRABLES_AND_DIRS = "/{,*/**/}*{#{DOT_RB},#{DL_EXTENSIONS.join(',')},/}"
|
8
16
|
NORMALIZE_NATIVE_EXTENSIONS = !DL_EXTENSIONS.include?(LoadPathCache::DOT_SO)
|
9
17
|
ALTERNATIVE_NATIVE_EXTENSIONS_PATTERN = /\.(o|bundle|dylib)\z/
|
10
18
|
BUNDLE_PATH = (Bundler.bundle_path.cleanpath.to_s << LoadPathCache::SLASH).freeze
|
@@ -29,12 +37,13 @@ module Bootsnap
|
|
29
37
|
next if contains_bundle_path && absolute_path.start_with?(BUNDLE_PATH)
|
30
38
|
relative_path = absolute_path.slice!(relative_slice)
|
31
39
|
|
32
|
-
if
|
33
|
-
dirs <<
|
40
|
+
if relative_path.end_with?('/')
|
41
|
+
dirs << relative_path[0..-2]
|
34
42
|
else
|
35
43
|
requirables << relative_path
|
36
44
|
end
|
37
45
|
end
|
46
|
+
|
38
47
|
[requirables, dirs]
|
39
48
|
end
|
40
49
|
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.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.0'
|
97
|
-
description:
|
97
|
+
description: Boot large ruby/rails apps faster
|
98
98
|
email:
|
99
99
|
- burke.libbey@shopify.com
|
100
100
|
executables: []
|
@@ -156,5 +156,5 @@ rubyforge_project:
|
|
156
156
|
rubygems_version: 2.4.8
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
|
-
summary:
|
159
|
+
summary: Boot large ruby/rails apps faster
|
160
160
|
test_files: []
|