philiprehberger-pipe 0.5.0 → 0.6.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: 206e72bfeb9f018e97cfc16de9bc949a4a3aed5e9db2233ba518eecee6dd26bb
4
- data.tar.gz: 131b303977095357838bc13485f9c6de066638ab18d53b6022f843ab572c859a
3
+ metadata.gz: ffeb34a9f39095064b69b03e6d2c12e74cd33ed79bb8e983b0a5fe67f7c1d111
4
+ data.tar.gz: f82fcafeb84c71360f5af11b2578f5d3c45178b31c657b755ffdd6b6a849c7b7
5
5
  SHA512:
6
- metadata.gz: 254d0c5b88f9c1cd1bd09d424962b7967e2b8417866068f6fc57d3fc41315a4d7df6a02224642954ae7fbfdb8e7599e064f204470226cff027a8e6529a49d894
7
- data.tar.gz: 86341cfcb6eb3882c78c9887fac496cc40e10b64e3fda31e72e0547078ff9ca0def68344052aba29672f9d00432809e36354b0985754a7291c446533df0134b6
6
+ metadata.gz: 3204ff61b36bd1f59379fd51798f006ac1b125d9414f29fbb8a9395e2b29c6ede142f1b2629fcf7bb6841e3944e3be6f1e3f15eae68ee45c9d1dc395ca9f46ab
7
+ data.tar.gz: 16b9deca075e89b3ee4497a559e6047ba2fd78781e928fe25116cbc862b19ae717f895ced188a0af91f94cf62a8f83b58f77a42b097533142040292eca6a2c4b
data/CHANGELOG.md CHANGED
@@ -3,10 +3,18 @@
3
3
  All notable changes to this gem will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this gem adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.6.0] - 2026-05-07
11
+
12
+ ### Added
13
+ - `Pipe#step_count` — returns the number of steps registered on the pipeline.
14
+
15
+ ### Changed
16
+ - CHANGELOG header wording aligned with the standard template ("this project adheres" instead of "this gem adheres").
17
+
10
18
  ## [0.5.0] - 2026-04-21
11
19
 
12
20
  ### Added
@@ -103,6 +111,8 @@ and this gem adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
103
111
  - Error short-circuiting
104
112
  - Tee steps for side effects
105
113
 
114
+ [0.6.0]: https://github.com/philiprehberger/rb-pipe/releases/tag/v0.6.0
115
+ [0.5.0]: https://github.com/philiprehberger/rb-pipe/releases/tag/v0.5.0
106
116
  [0.4.0]: https://github.com/philiprehberger/rb-pipe/releases/tag/v0.4.0
107
117
  [0.3.1]: https://github.com/philiprehberger/rb-pipe/releases/tag/v0.3.1
108
118
  [0.3.0]: https://github.com/philiprehberger/rb-pipe/releases/tag/v0.3.0
data/README.md CHANGED
@@ -148,6 +148,18 @@ result = Philiprehberger::Pipe.new(raw_input)
148
148
  .value
149
149
  ```
150
150
 
151
+ ### Inspecting Pipelines
152
+
153
+ ```ruby
154
+ require 'philiprehberger/pipe'
155
+
156
+ pipeline = Philiprehberger::Pipe.new
157
+ .step { |x| x * 2 }
158
+ .step { |x| x + 1 }
159
+
160
+ pipeline.step_count # => 2
161
+ ```
162
+
151
163
  ## API
152
164
 
153
165
  | Method | Description |
@@ -163,6 +175,7 @@ result = Philiprehberger::Pipe.new(raw_input)
163
175
  | `#to_proc` | Convert to Proc for use with `&` operator |
164
176
  | `#on_error(&block)` | Set an error handler for the pipeline |
165
177
  | `#value` | Execute the pipeline using the initial value |
178
+ | `#step_count` | Returns the number of steps currently in the pipeline |
166
179
 
167
180
  ## Development
168
181
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Philiprehberger
4
4
  class Pipe
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
@@ -66,6 +66,15 @@ module Philiprehberger
66
66
  @pipeline.execute(@initial_value, error_handler: @error_handler)
67
67
  end
68
68
 
69
+ # Number of steps currently registered on the pipeline.
70
+ # Includes both transform and tee steps. After `compose`/`>>`,
71
+ # equals the sum of both inputs' step counts.
72
+ #
73
+ # @return [Integer]
74
+ def step_count
75
+ @pipeline.steps.size
76
+ end
77
+
69
78
  protected
70
79
 
71
80
  attr_reader :pipeline
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philiprehberger-pipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.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-21 00:00:00.000000000 Z
11
+ date: 2026-05-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby library for functional pipeline composition with named steps,
14
14
  pipeline composition, reusable call/to_proc interface, intermediate value capture,