Skip to content

Commit d42401a

Browse files
authored
Merge pull request #63 from pabloh/remove_deprecated_behaviour
Remove deprecated behaviour
2 parents e394e60 + 370a004 commit d42401a

2 files changed

Lines changed: 12 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
## [1.3.0] - 2026-04-01
1+
## [1.3.0] - 2026-03-25
22
### Changed
33
- Removed support for `Ruby` versions older than 3.3
44
### Removed
5+
- Remove support for passing a block to the step method through `DSLMethods#step`
6+
- Remove support for passing a block to the step method through `DSLMethods#set`
57
- Remove support for `DSLMethods#map`
68

79
## [1.2.0] - 2025-11-16
810
### Deprecated
9-
- Deprecate passing a block to the step method using `DSLMethods#step`
10-
- Deprecate passing a block to the step method using `DSLMethods#set`
11+
- Deprecate passing a block to the step method through `DSLMethods#step`
12+
- Deprecate passing a block to the step method through `DSLMethods#set`
1113
- Deprecate `DSLMethods#map`
1214
### Changed
1315
- Removed deprecated `:auto_wire_options` option from `:dry_validation` plugin

lib/pathway.rb

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def default_message_for(type)
5858
class State
5959
extend Forwardable
6060

61-
delegate %i([] []= fetch store include? values_at deconstruct_keys) => :@hash
61+
delegate %i[[] []= fetch store include? values_at deconstruct_keys] => :@hash
6262

6363
def initialize(operation, values = {})
6464
@hash = operation.context.merge(values)
@@ -158,27 +158,17 @@ def run(&)
158158
end
159159

160160
# Execute step and preserve the former state
161-
def step(callable, ...)
162-
#:nocov:
163-
if block_given?
164-
warn "[DEPRECATION] Passing a block to the step method using `DSLMethods#step` is deprecated"
165-
end
166-
#:nocov:
167-
bl = _callable(callable)
168-
@result = @result.tee { |state| bl.call(state, ...) }
161+
def step(callable, *, **, &)
162+
bl = _callable(callable, &)
163+
@result = @result.tee { |state| bl.call(state, *, **) }
169164
end
170165

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

180170
@result = @result.then do |state|
181-
wrap(bl.call(state, *args, **kwargs, &bl))
171+
wrap(bl.call(state, *args, **kwargs))
182172
.then { |value| state.update(to => value) }
183173
end
184174
end

0 commit comments

Comments
 (0)