philiprehberger-task_runner 0.3.0 → 0.4.0

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: 590a04ed4c85ae234b9a0d43827629228ad40905b4519de722ccface3b4c1a94
4
- data.tar.gz: dff5e1dc4852a48dcd6baec3355ad54294854bae050663ec72383dd23705e49b
3
+ metadata.gz: 0edebc1ac881ac5547d09cc825898875461f22b5b13edd6c5c01b3efc9d7a13f
4
+ data.tar.gz: f7172ad5068e86cb31fa0cb48f1eac41b21f239ff884f9333f52b52d33df29bb
5
5
  SHA512:
6
- metadata.gz: ad0d734a2a0e763e6f8bff1fd0baf02c0351be84f73e3fd7b40fd9846f751c9b73d9c77fda9e3149aea65c3f3b31fbc66e1d3002b3c84b030c726d4b6085eac7
7
- data.tar.gz: a1794ab2ad9d37557c340d91c70d7167fb4befe9d9b5dc0195daaedae951c0a154c60f8704aed4563eba651ce5a5bd92f06bf994e1795e51de4dd7c14d8fff01
6
+ metadata.gz: 96f98887b963b6e19cd0025b1d2621571422b21ec7c7e72f936892b4f768b0f023590da3591b575deaf8b6395c8d5b27fe3a6ff56bb0a057159f594383323a40
7
+ data.tar.gz: 84271258a850cc7dbb6a3bda26db60c55b7a43b61b9323659eec0ecbe4bc83f1bfe804ade2b33922de9643418becdc8f595231fa9cf84e9663e57b85ca1a8e15
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2026-04-20
11
+
12
+ ### Added
13
+ - `Result#failure?` — logical inverse of `#success?` for clearer branching
14
+ - `Result#timed_out?` — true when the process was killed by the task runner for exceeding its timeout (`:TERM` or `:KILL` signal)
15
+ - `:timed_out` key added to `Result#to_h` alongside the existing `:success` flag
16
+
10
17
  ## [0.3.0] - 2026-04-09
11
18
 
12
19
  ### Added
data/README.md CHANGED
@@ -122,9 +122,11 @@ end
122
122
  | `Result#stderr` | Captured standard error |
123
123
  | `Result#exit_code` | Process exit code |
124
124
  | `Result#success?` | Whether exit code is 0 |
125
+ | `Result#failure?` | Logical inverse of `#success?` |
125
126
  | `Result#duration` | Execution time in seconds |
126
127
  | `Result#signal` | Signal that killed the process (:TERM, :KILL, or nil) |
127
- | `Result#to_h` | Hash representation of the result |
128
+ | `Result#timed_out?` | Whether the process was killed for exceeding its timeout |
129
+ | `Result#to_h` | Hash representation of the result (includes `:success` and `:timed_out`) |
128
130
 
129
131
  ## Development
130
132
 
@@ -39,6 +39,22 @@ module Philiprehberger
39
39
  @exit_code.zero?
40
40
  end
41
41
 
42
+ # Whether the command exited with a non-zero status, was killed by a
43
+ # signal, or timed out. The logical inverse of {#success?}.
44
+ #
45
+ # @return [Boolean]
46
+ def failure?
47
+ !success?
48
+ end
49
+
50
+ # Whether the command was terminated by the task runner because it
51
+ # exceeded its timeout (SIGTERM or SIGKILL).
52
+ #
53
+ # @return [Boolean]
54
+ def timed_out?
55
+ %i[TERM KILL].include?(@signal)
56
+ end
57
+
42
58
  # Hash representation of the result.
43
59
  #
44
60
  # @return [Hash]
@@ -49,7 +65,8 @@ module Philiprehberger
49
65
  exit_code: @exit_code,
50
66
  duration: @duration,
51
67
  signal: @signal,
52
- success: success?
68
+ success: success?,
69
+ timed_out: timed_out?
53
70
  }
54
71
  end
55
72
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Philiprehberger
4
4
  module TaskRunner
5
- VERSION = '0.3.0'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philiprehberger-task_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Rehberger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-10 00:00:00.000000000 Z
11
+ date: 2026-04-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Run shell commands with captured stdout/stderr, exit code, duration measurement,
14
14
  configurable timeout, environment variables, line-by-line streaming, graceful signal