Skip to content

Commit e735bbd

Browse files
committed
Deprecate some features on DSL methods
1 parent 0310d9c commit e735bbd

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## [1.2.0] - 2025-06-01
1+
## [1.2.0] - 2025-11-16
2+
### Deprecated
3+
- Deprecate passing a block to the step method using `DSLMethods#step`
4+
- Deprecate passing a block to the step method using `DSLMethods#set`
5+
- Deprecate `DSLMethods#map`
26
### Changed
37
- Removed deprecated `:auto_wire_options` option from `:dry_validation` plugin
48

lib/pathway.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,22 @@ def run(&steps)
157157

158158
# Execute step and preserve the former state
159159
def step(callable,...)
160+
#:nocov:
161+
if block_given?
162+
warn "[DEPRECATION] Passing a block to the step method using `DSLMethods#step` is deprecated"
163+
end
164+
#:nocov:
160165
bl = _callable(callable)
161166
@result = @result.tee { |state| bl.call(state,...) }
162167
end
163168

164169
# Execute step and modify the former state setting the key
165170
def set(callable, *args, to: @operation.result_key, **kwargs, &bl)
171+
#:nocov:
172+
if block_given?
173+
warn "[DEPRECATION] Passing a block to the step method using `DSLMethods#set` is deprecated"
174+
end
175+
#:nocov:
166176
bl = _callable(callable)
167177

168178
@result = @result.then do |state|
@@ -173,6 +183,9 @@ def set(callable, *args, to: @operation.result_key, **kwargs, &bl)
173183

174184
# Execute step and replace the current state completely
175185
def map(callable,...)
186+
#:nocov:
187+
warn "[DEPRECATION] `Pathway::DSLMethods#map` has been deprecated, use `step` instead"
188+
#:nocov:
176189
bl = _callable(callable)
177190
@result = @result.then { |state| bl.call(state,...) }
178191
end

lib/pathway/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Pathway
4-
VERSION = '1.1.0'
4+
VERSION = '1.2.0'
55
end

0 commit comments

Comments
 (0)