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

Make it compatible with Ruby 3 #21

Merged
merged 1 commit into from
Jul 28, 2023
Merged

Make it compatible with Ruby 3 #21

merged 1 commit into from
Jul 28, 2023

Conversation

dck
Copy link
Contributor

@dck dck commented Jul 26, 2023

ResponseError exception was created passing a hash as single argument. The exception class expects 2 keyword arguments. Before Ruby 3.0 it was working fine because Ruby automatically converted a hash to keyword args.

Starting from Ruby 3.0 a double splat operator is required otherwise the entire hash it treated as single positional argument.

Before this fix both specs and production code failed with:

ArgumentError: wrong number of arguments (given 1, expected 0; required keywords: code, message)

ResponseError exception was created passing a hash
as single argument. The exception class expect 2 keyword args.
Before Ruby 3.0 it was working fine because Ruby automatically
converted hash to keyword args.
Startng from Ruby 3.0 a double splat operator is required
otherwise the entire hash it treated as single positional argument.
@FZambia
Copy link
Member

FZambia commented Jul 28, 2023

@dck hello, thank you!

@FZambia FZambia merged commit 72266c7 into centrifugal:master Jul 28, 2023
1 check passed
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