bootsnap 1.5.0 → 1.5.1
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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a15b298603bbdda820fa4aa3d37e32c72f181aa49aac240a02f076de2dd17eb
|
4
|
+
data.tar.gz: bbce00645395d42d30cb3c89b35dcb910003e3f9c3b65afd3a94b7e9019b868a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 982d29eb952ba2c053fd78d244493fc2c75d148f11bed24c67e657c0b59d1d6cb4cfc964583087dfababe0b3f977aa9d183c67c69949a31b1dca65c5d51886a4
|
7
|
+
data.tar.gz: 9e862ebb9a2ddb6cebdfec4835e78c9fcf14dd1451af73a6f04bf38edb362111f27cb70a04e381cb9550cdbdf4cf83d838aaf514126a41e1c9f1c1a12ab96417
|
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
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.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|