bootsnap 1.5.0-java → 1.5.1-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/lib/bootsnap/cli.rb +26 -11
- data/lib/bootsnap/compile_cache/iseq.rb +1 -1
- data/lib/bootsnap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e47e79a249ef1acc7e88a7d7a3aafa712a956f5bd98691ae60ce7f3efaad4fd
|
4
|
+
data.tar.gz: 85c1e87d8dc0d08a8391360394b5a1b112d4645637e30c18410edeebdf816e7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c25382226d335b8b597e180cd56730af63cfbc93075cb2a37f381779931ce83728be95c5874c3823de10bbbcd3cd3133db42c5c1cdd6f8ba0e3a43e50da067dc
|
7
|
+
data.tar.gz: 9da0dea845b2e2e9ac63d10ff54525102ff075f732c3da28a8a62d5745873e33e78fca9760ceafbba7ab8434930bebb63e81a78af932521606176a0a0d541636
|
data/CHANGELOG.md
CHANGED
data/lib/bootsnap/cli.rb
CHANGED
@@ -8,7 +8,7 @@ module Bootsnap
|
|
8
8
|
class CLI
|
9
9
|
unless Regexp.method_defined?(:match?)
|
10
10
|
module RegexpMatchBackport
|
11
|
-
refine
|
11
|
+
refine Regexp do
|
12
12
|
def match?(string)
|
13
13
|
!!match(string)
|
14
14
|
end
|
@@ -23,7 +23,7 @@ module Bootsnap
|
|
23
23
|
|
24
24
|
def initialize(argv)
|
25
25
|
@argv = argv
|
26
|
-
self.cache_dir = 'tmp/cache'
|
26
|
+
self.cache_dir = ENV.fetch('BOOTSNAP_CACHE_DIR', 'tmp/cache')
|
27
27
|
self.compile_gemfile = false
|
28
28
|
self.exclude = nil
|
29
29
|
end
|
@@ -31,17 +31,19 @@ module Bootsnap
|
|
31
31
|
def precompile_command(*sources)
|
32
32
|
require 'bootsnap/compile_cache/iseq'
|
33
33
|
|
34
|
-
|
34
|
+
fix_default_encoding do
|
35
|
+
Bootsnap::CompileCache::ISeq.cache_dir = self.cache_dir
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
if compile_gemfile
|
38
|
+
sources += $LOAD_PATH
|
39
|
+
end
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
sources.map { |d| File.expand_path(d) }.each do |path|
|
42
|
+
if !exclude || !exclude.match?(path)
|
43
|
+
list_ruby_files(path).each do |ruby_file|
|
44
|
+
if !exclude || !exclude.match?(ruby_file)
|
45
|
+
CompileCache::ISeq.fetch(ruby_file, cache_dir: cache_dir)
|
46
|
+
end
|
45
47
|
end
|
46
48
|
end
|
47
49
|
end
|
@@ -91,6 +93,19 @@ module Bootsnap
|
|
91
93
|
|
92
94
|
private
|
93
95
|
|
96
|
+
def fix_default_encoding
|
97
|
+
if Encoding.default_external == Encoding::US_ASCII
|
98
|
+
Encoding.default_external = Encoding::UTF_8
|
99
|
+
begin
|
100
|
+
yield
|
101
|
+
ensure
|
102
|
+
Encoding.default_external = Encoding::US_ASCII
|
103
|
+
end
|
104
|
+
else
|
105
|
+
yield
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
94
109
|
def invalid_usage!(message)
|
95
110
|
STDERR.puts message
|
96
111
|
STDERR.puts
|
data/lib/bootsnap/version.rb
CHANGED