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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6981435a732015b8043d7ffc3a63c0603b6f1de300db2610becafc93c25b91e
4
- data.tar.gz: d977b2ee4969224edd10530a4cb4332bcaea0298f8f147e4e3aaf846cbc584ab
3
+ metadata.gz: 2e47e79a249ef1acc7e88a7d7a3aafa712a956f5bd98691ae60ce7f3efaad4fd
4
+ data.tar.gz: 85c1e87d8dc0d08a8391360394b5a1b112d4645637e30c18410edeebdf816e7f
5
5
  SHA512:
6
- metadata.gz: d544e765dcc1ccd998ffd0c65ee8aeda19e0a8a37cc37a0fbcb9917384283d27902acb81c079ec7c6b3cb1fe2ffb4fa752b1b668ae34bfdfc0b695cf943159bb
7
- data.tar.gz: 7036e0b6c86ada90a48fe5d384b029c2c2f383e3231d3bcab43cc6bb765ef49cce4dc785120bac88c293aae2f24f4e23ba6d15ba9eb5ffa953eb0f8843e5e588
6
+ metadata.gz: c25382226d335b8b597e180cd56730af63cfbc93075cb2a37f381779931ce83728be95c5874c3823de10bbbcd3cd3133db42c5c1cdd6f8ba0e3a43e50da067dc
7
+ data.tar.gz: 9da0dea845b2e2e9ac63d10ff54525102ff075f732c3da28a8a62d5745873e33e78fca9760ceafbba7ab8434930bebb63e81a78af932521606176a0a0d541636
@@ -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,7 +1,7 @@
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: java
6
6
  authors:
7
7
  - Burke Libbey