binpacker 0.0.1 → 0.0.3

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: 653b179edc29b5ba11d913c383a1313056dc4fd4894447246579d6a753fa425c
4
+ data.tar.gz: 63dbd707c566666418d5fa6fa29f065fa98fad2403a49b1b9b3d6a0781bcc545
5
5
  SHA512:
6
- metadata.gz: c97dc45f7a65bb202498407b08bd41ebe9d096331150b0319eca1caee21fd7213238a94198b174b182e08bf06421a0dbc0ef0bff4ffdd7056214e3958ad03b83
7
- data.tar.gz: e67e482ec9be17d650405c589857465444bdc1084aeeec9e81f69f0eceb8652a1ee4d0ae0baf45f2744f44801f392657d742e773f9c6ad69f0cf8dc31aeaaac8
6
+ metadata.gz: 3230811750d77247fc627f6f1d3faeb7bd530fd4b24b80c2020685b5bac89a9d6b324d30910ee05328a122480c961349aff0882d63414e50f2ef71cb3e413157
7
+ data.tar.gz: aa1c67a29007d95bff7c22d3e80dfab0b6de851ca290d307a5a945b26467e01407900048e0881222d5b5a4c26b00cfe996347f96c060c2aa30f2aac943575e7c
data/exe/binpacker-worker CHANGED
@@ -11,13 +11,13 @@ def run_rspec(files, wid, rspec_args)
11
11
  cmd = [
12
12
  "rspec",
13
13
  "--format", "json", "--out", outfile.path,
14
- "--format", "progress", "--out", $stderr.fileno.to_s,
14
+ "--format", "progress", "--out", "/dev/stderr",
15
15
  *rspec_args,
16
16
  *files
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.3"
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - megurine