kennel 1.1.1 → 1.1.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: b169b9220da9861c6fdfcb83be156a8185b2fce504766d1f7f33b4a1686bee50
4
- data.tar.gz: dfe64486ec9141a29ce3a792010dfe2556ccd502d1d64ac677418a84b5171989
3
+ metadata.gz: 9bf335a398bfa1624477d3f940074c2f00c21a5a8e3c87f651e60152fe27243c
4
+ data.tar.gz: ca60de46645d955e8763473327f5223a203674b1a9bf06d9c6e1fbae6dfe7a84
5
5
  SHA512:
6
- metadata.gz: 2f67a5d600c2d47ef4103a85989da01a918d6cb0a75decba1467ceaf90b334a8f60437d6d8c7a3da87b01598455a2f802cdca7e5cd83c44f9bea0d5d93bc9f4d
7
- data.tar.gz: ced3b5243dc7cfed3a7d354072a8c54c70135712dad21b02296ba5b6bd70930370c248ac67c2710659f9f10f94cb16e7c8859dc855799525175043cc7c1c91e7
6
+ metadata.gz: 6468378d28fa553051cb487931983f6694acb4c29a4faeb9dd67554b683b81c0255a2d8b4353fbc806b7e223c7539c129950d51290e206674a908c8a9db04bb2
7
+ data.tar.gz: 2ce64288f9075607e73bd3099248a255972a37c07ffcb8e32dc8e540e4334957a14b084cccfcdc4a2377f7b03305e68c2b58b65ce27e15fa08c3bc8d0a02be59
@@ -16,7 +16,10 @@ module Kennel
16
16
  end
17
17
 
18
18
  def report(&block)
19
- output = Utils.strip_shell_control(Utils.tee_stdout(&block).strip)
19
+ output = Utils.strip_shell_control(Utils.tee_output(&block).strip)
20
+ rescue StandardError
21
+ output = "Error:\n#{$ERROR_INFO.message}"
22
+ raise
20
23
  ensure
21
24
  comment "```\n#{output || "Error"}\n```"
22
25
  end
data/lib/kennel/utils.rb CHANGED
@@ -51,14 +51,26 @@ module Kennel
51
51
  $stdout = old
52
52
  end
53
53
 
54
- def tee_stdout
55
- old = $stdout
56
- string = StringIO.new
57
- $stdout = TeeIO.new([$stdout, string])
54
+ def capture_stderr
55
+ old = $stderr
56
+ $stderr = StringIO.new
58
57
  yield
59
- string.string
58
+ $stderr.string
60
59
  ensure
61
- $stdout = old
60
+ $stderr = old
61
+ end
62
+
63
+ def tee_output
64
+ old_stdout = $stdout
65
+ old_stderr = $stderr
66
+ capture = StringIO.new
67
+ $stdout = TeeIO.new([capture, $stdout])
68
+ $stderr = TeeIO.new([capture, $stderr])
69
+ yield
70
+ capture.string
71
+ ensure
72
+ $stderr = old_stderr
73
+ $stdout = old_stdout
62
74
  end
63
75
 
64
76
  def capture_sh(command)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-18 00:00:00.000000000 Z
11
+ date: 2018-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday