bitfab 0.63.2 → 0.63.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/lib/bitfab/cloud_replay_cli.rb +19 -1
- data/lib/bitfab/version.rb +1 -1
- 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: 9bdf38fe33f2604b75bff7b55563ab01c4d11d054f9be7ea835cf6257ab28a8d
|
|
4
|
+
data.tar.gz: 67612c39485c8c77919c12d3fd1f28277884bdc99de8830f1a27ef2851ef7cbc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f61307786696fdd141a061cda79b037c41951eb2c7b8d47015ac55a21da159e9abb32d64b908287da3263fb6378033135220d7fe44741a594293b08ed3329735
|
|
7
|
+
data.tar.gz: a5a85947d8ee4d653fff252bec31c6cfb9e9eb87f38b5a1780dda09d9055a475b251acd9088a59fb48837a2fdeb86cd526c8decdec3b89cd36b10cab267e4058
|
|
@@ -42,10 +42,28 @@ module Bitfab
|
|
|
42
42
|
stdout.write result_output
|
|
43
43
|
return {}
|
|
44
44
|
end
|
|
45
|
-
result =
|
|
45
|
+
result = parse_result(result_output, stdout)
|
|
46
46
|
stdout.puts JSON.pretty_generate(result)
|
|
47
47
|
result
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
|
+
|
|
51
|
+
def parse_result(output, stdout)
|
|
52
|
+
commands, rest = output.lines.partition { |line| line.start_with?("::") }
|
|
53
|
+
commands.each { |line| stdout.puts line.chomp }
|
|
54
|
+
stdout.flush
|
|
55
|
+
(rest.length - 1).downto(0) do |start|
|
|
56
|
+
next unless rest[start].start_with?("{")
|
|
57
|
+
begin
|
|
58
|
+
result = JSON.parse(rest[start..].join)
|
|
59
|
+
return result if result.is_a?(Hash)
|
|
60
|
+
rescue JSON::ParserError
|
|
61
|
+
next
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
text = rest.join
|
|
65
|
+
stdout.puts text unless text.strip.empty?
|
|
66
|
+
raise ArgumentError, "Cloud replay did not print a JSON result; its output is above"
|
|
67
|
+
end
|
|
50
68
|
end
|
|
51
69
|
end
|
data/lib/bitfab/version.rb
CHANGED