Skip to content

Fix ruby 3 error when keyword argument is passed #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2022

Conversation

lulalala
Copy link
Collaborator

@lulalala lulalala commented Sep 4, 2022

In Ruby 3, keyword arguments must be splat separately (using double splat):

https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

This would mean the gem will no longer be compatible to Ruby < 2.0


# Default the arguments to an empty array. Otherwise in Ruby 1.8
# a `nil` args will actually pass `nil` into the class. Not what
# we want!
args ||= []
kwargs ||= {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only added this line because runner_spec omits args, and only passes in klass. This wouldn't happen if builder is used.

However, if we no longer support Ruby 1.8, I wonder if we should remove this block all together, and amend runner_spec instead?

@lulalala
Copy link
Collaborator Author

Hi @lilobase would you know whom I can ask for review please? Thanks.

@lilobase lilobase merged commit ef92f1a into Ibsciss:master Sep 18, 2022
@lilobase
Copy link
Member

Hello, sorry I didn't see your PR, many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants