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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2540d5dccef7466e75321e3c503b9c6d10aa6195ea905ed75336ad56f6eea2d0
4
- data.tar.gz: 2d36002c885f981b1dd77e211cdc5583a97328995a15c14ca4a127fa74043214
3
+ metadata.gz: 9a15b298603bbdda820fa4aa3d37e32c72f181aa49aac240a02f076de2dd17eb
4
+ data.tar.gz: bbce00645395d42d30cb3c89b35dcb910003e3f9c3b65afd3a94b7e9019b868a
5
5
  SHA512:
6
- metadata.gz: 672246870422714d082b8233c9bd51d45cf96db5ff6f37f609aafeee208e74822619059df66af56562650c61c655b73c550767b24d76ee9018c088283838bd2e
7
- data.tar.gz: 6e6aa8e96453eda1f8c46ffa0aedf7e39a59168d31ef1dc54aaf1de1d86d8bcd67324f668406b068a6f8a42b13178d91c301a9bbe8512058a4907de9233787b7
6
+ metadata.gz: 982d29eb952ba2c053fd78d244493fc2c75d148f11bed24c67e657c0b59d1d6cb4cfc964583087dfababe0b3f977aa9d183c67c69949a31b1dca65c5d51886a4
7
+ data.tar.gz: 9e862ebb9a2ddb6cebdfec4835e78c9fcf14dd1451af73a6f04bf38edb362111f27cb70a04e381cb9550cdbdf4cf83d838aaf514126a41e1c9f1c1a12ab96417
@@ -1,3 +1,7 @@
1
+ # 1.5.1
2
+
3
+ * Workaround a Ruby bug in InstructionSequence.compile_file. (#332)
4
+
1
5
  # 1.5.0
2
6
 
3
7
  * Add a command line to statically precompile the ISeq cache. (#326)
@@ -8,7 +8,7 @@ module Bootsnap
8
8
  class CLI
9
9
  unless Regexp.method_defined?(:match?)
10
10
  module RegexpMatchBackport
11
- refine Regepx do
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
- Bootsnap::CompileCache::ISeq.cache_dir = self.cache_dir
34
+ fix_default_encoding do
35
+ Bootsnap::CompileCache::ISeq.cache_dir = self.cache_dir
35
36
 
36
- if compile_gemfile
37
- sources += $LOAD_PATH
38
- end
37
+ if compile_gemfile
38
+ sources += $LOAD_PATH
39
+ end
39
40
 
40
- sources.map { |d| File.expand_path(d) }.each do |path|
41
- if !exclude || !exclude.match?(path)
42
- list_ruby_files(path).each do |ruby_file|
43
- if !exclude || !exclude.match?(ruby_file)
44
- CompileCache::ISeq.fetch(ruby_file, cache_dir: cache_dir)
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
@@ -35,7 +35,7 @@ module Bootsnap
35
35
  )
36
36
  end
37
37
 
38
- def self.input_to_output(_, _)
38
+ def self.input_to_output(_data, _kwargs)
39
39
  nil # ruby handles this
40
40
  end
41
41
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Bootsnap
3
- VERSION = "1.5.0"
3
+ VERSION = "1.5.1"
4
4
  end
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.0
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-02 00:00:00.000000000 Z
11
+ date: 2020-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler