Skip to content
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

Unpack the hash for ruby 3 support #78

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Jan 11, 2022

In prior rubies, this hash was unpacked as the only value in an array. Ruby 3 no
longer accepts kwargs or implicit hashes as the last argument sent to a method.

Since Runner#initialize accepts only kwargs, it's far easier to just change this
to unpack the hash into kwargs using double splat.
This was tested for ruby 2.6, 2.7, and 3.0.

In prior rubies, this hash was unpacked as the only value in an array. Ruby 3 no
longer accepts kwargs or implicit hashes as the last argument sent to a method.

Since Runner#initialize accepts only kwargs, it's far easier to just change this
to unpack the hash into kwargs using double splat.
This was tested for for ruby 2.6, 2.7, and 3.0.
@Fryguy
Copy link
Member

Fryguy commented Jan 11, 2022

@agrare Super-technically this is a breaking change as if anyone was actually passing an Array with a Hash in it, then that will not longer work, but that seems super-unlikely, and wasn't the prescribed way of using it, so I think this is just a patch release fix.

@Fryguy Fryguy added bug Something isn't working ruby3 labels Jan 11, 2022
@Fryguy Fryguy merged commit 68149d9 into ManageIQ:master Jan 11, 2022
@jrafanie jrafanie deleted the ruby_3_support branch January 11, 2022 16:23
jrafanie added a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Jan 11, 2022
Testing if ManageIQ/manageiq-cross_repo#78 will get pulled in and used for ruby 3 support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ruby3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants