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 +4 -4
- data/exe/binpacker-worker +2 -2
- data/lib/binpacker/timing.rb +4 -4
- data/lib/binpacker/version.rb +1 -1
- data/lib/binpacker/worker.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 653b179edc29b5ba11d913c383a1313056dc4fd4894447246579d6a753fa425c
|
|
4
|
+
data.tar.gz: 63dbd707c566666418d5fa6fa29f065fa98fad2403a49b1b9b3d6a0781bcc545
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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",
|
|
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
|
|
data/lib/binpacker/timing.rb
CHANGED
|
@@ -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
|
data/lib/binpacker/version.rb
CHANGED
data/lib/binpacker/worker.rb
CHANGED
|
@@ -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,
|