centrifugal / rubycent

Ruby gem to communicate with Centrifugo HTTP API
MIT License
20 stars 15 forks source link

Make it compatible with Ruby 3 #21

Closed dck closed 1 year ago

dck commented 1 year ago

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)
FZambia commented 1 year ago

@dck hello, thank you!