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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc609d9aaa9ba7366c855624027df97620baf1309fc38192316305e94e7de4e5
4
- data.tar.gz: 2562479d249da81b28b80a8bb176438ac60bdf6c82135f348afb252e09c005a7
3
+ metadata.gz: 9bdf38fe33f2604b75bff7b55563ab01c4d11d054f9be7ea835cf6257ab28a8d
4
+ data.tar.gz: 67612c39485c8c77919c12d3fd1f28277884bdc99de8830f1a27ef2851ef7cbc
5
5
  SHA512:
6
- metadata.gz: 4df6fafa2a4ae84186457257339cbdabeb88c43713147541aa4b66b4ccc6888f39822f92ee3e11662f70800892066907c9904f61f03ec8c1c1206ee717f5d3bf
7
- data.tar.gz: 9137bc781a7d3f87b8c4f575ddc90a9bf369d1b7c84657c32f038fd12e6bcffb4d33fd95dda28cb6b0f551fc74bb5d3bb627df7a57116ec88a31c8060b459793
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 = JSON.parse(result_output)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.63.2"
4
+ VERSION = "0.63.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.63.2
4
+ version: 0.63.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team