Skip to content

Commit

Permalink
Always give names to parameters so that dry_auto-inject forwards depe…
Browse files Browse the repository at this point in the history
…ndencies

An alternative would be a lot more complex, we'd need to construct a "correct" `initialize` signature which is really hard in presence of inheritance.
  • Loading branch information
flash-gordon committed Jan 1, 2025
1 parent ba4e000 commit 69eb4c5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/dry/initializer/mixin/root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ module Mixin
module Root
private

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2")
module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
def initialize(*, **)
__dry_initializer_initialize__(*, **)
end
RUBY
else
def initialize(*args, **kwargs)
__dry_initializer_initialize__(*args, **kwargs)
end
def initialize(*args, **kwargs)
__dry_initializer_initialize__(*args, **kwargs)
end
end
end
Expand Down

0 comments on commit 69eb4c5

Please sign in to comment.