binpacker 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86455b4d4ae7992aebada5dc2c22a24f5703b5ac89d36796cdc448492d79ec17
4
- data.tar.gz: ffa497df54aaa41919e82230997fc6e46f303328bbd0f37ed95607a14bd9d090
3
+ metadata.gz: dcccb4abff247eeed5a058911b3a1a652fc777c82fdc35aa87646205f3877162
4
+ data.tar.gz: 87d45957d616c818fd8bfb5545d48ea2dfddae19b62324c6699f663ca68fd9a8
5
5
  SHA512:
6
- metadata.gz: c97dc45f7a65bb202498407b08bd41ebe9d096331150b0319eca1caee21fd7213238a94198b174b182e08bf06421a0dbc0ef0bff4ffdd7056214e3958ad03b83
7
- data.tar.gz: e67e482ec9be17d650405c589857465444bdc1084aeeec9e81f69f0eceb8652a1ee4d0ae0baf45f2744f44801f392657d742e773f9c6ad69f0cf8dc31aeaaac8
6
+ metadata.gz: bd376b5a722d561b0d167bb7f29d3b90d4359d1fe9b2f9fc1f21236664702b12c7db57fe6de14e004bd539b1724e193fe956ee1c221c86f74cb2d0fb0c77ce16
7
+ data.tar.gz: b748f67ef840a79fdfcee0f4d70da15278cb982c5764f2a171471fa056add38edb03ecfbef916a557c933d678d0ffccdd8432dd95f4caba07e07c9810900d565
data/exe/binpacker-worker CHANGED
@@ -17,7 +17,7 @@ def run_rspec(files, wid, rspec_args)
17
17
  ]
18
18
  success = system(*cmd)
19
19
 
20
- data = (File.exist?(outfile.path) && File.size(outfile.path) > 0) ? JSON.parse(File.read(outfile.path)) : {}
20
+ data = (File.exist?(outfile.path) && File.size(outfile.path) > 0) ? JSON.parse(File.read(outfile.path, encoding: "UTF-8")) : {}
21
21
  examples = data["examples"] || []
22
22
  summary = data["summary"] || {}
23
23
 
@@ -23,7 +23,7 @@ module Binpacker
23
23
  def load_raw
24
24
  return {} unless @path.exist?
25
25
 
26
- @path.each_line
26
+ @path.each_line(encoding: "UTF-8")
27
27
  .map { |line| parse_line(line) }
28
28
  .compact
29
29
  .group_by { |e| [normalize_path(e.file), e.name] }
@@ -33,7 +33,7 @@ module Binpacker
33
33
  def load_per_file
34
34
  return {} unless @path.exist?
35
35
 
36
- @path.each_line
36
+ @path.each_line(encoding: "UTF-8")
37
37
  .map { |line| parse_line(line) }
38
38
  .compact
39
39
  .group_by { |e| normalize_path(e.file) }
@@ -51,13 +51,13 @@ module Binpacker
51
51
 
52
52
  def append(file:, name:, time:)
53
53
  @path.dirname.mkpath unless @path.dirname.directory?
54
- @path.open("a") { |io| io.puts JSON.generate({ file: file, name: name, time: time }) }
54
+ @path.open("a", encoding: "UTF-8") { |io| io.puts JSON.generate({ file: file, name: name, time: time }) }
55
55
  end
56
56
 
57
57
  def append_all(entries)
58
58
  return if entries.empty?
59
59
  @path.dirname.mkpath unless @path.dirname.directory?
60
- @path.open("a") do |io|
60
+ @path.open("a", encoding: "UTF-8") do |io|
61
61
  entries.each { |e| io.puts JSON.generate({ file: e[:file], name: e[:name], time: e[:time] }) }
62
62
  end
63
63
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Binpacker
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
@@ -20,9 +20,9 @@ module Binpacker
20
20
  def start
21
21
  worker_script = File.expand_path("../../exe/binpacker-worker", __dir__)
22
22
 
23
- @stdin_r, @stdin_w = IO.pipe
24
- @stdout_r, @stdout_w = IO.pipe
25
- @stderr_r, @stderr_w = IO.pipe
23
+ @stdin_r, @stdin_w = IO.pipe(encoding: "UTF-8")
24
+ @stdout_r, @stdout_w = IO.pipe(encoding: "UTF-8")
25
+ @stderr_r, @stderr_w = IO.pipe(encoding: "UTF-8")
26
26
 
27
27
  @pid = Process.spawn(
28
28
  RbConfig.ruby, worker_script,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binpacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - megurine