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 +4 -4
- data/CHANGELOG.md +11 -1
- data/README.md +13 -0
- data/lib/philiprehberger/pipe/version.rb +1 -1
- data/lib/philiprehberger/pipe.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ffeb34a9f39095064b69b03e6d2c12e74cd33ed79bb8e983b0a5fe67f7c1d111
|
|
4
|
+
data.tar.gz: f82fcafeb84c71360f5af11b2578f5d3c45178b31c657b755ffdd6b6a849c7b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
|
data/lib/philiprehberger/pipe.rb
CHANGED
|
@@ -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.
|
|
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-
|
|
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,
|