Skip to content

Commit

Permalink
Fix for ruby 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
flash-gordon committed Dec 30, 2024
1 parent e8e0ad6 commit ba4e000
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/dry/initializer/mixin/root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ module Mixin
module Root
private

def initialize(*, **)
__dry_initializer_initialize__(*, **)
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
end
end
end
Expand Down

0 comments on commit ba4e000

Please sign in to comment.