simple_enum
simple_enum copied to clipboard
Use double-splat for Ruby 3.0 compatibility
Ruby 3.0 separates keyword arguments from positional arguments. https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
This PR makes simple_enum
compatible with the new behavior. As **
isn't supported in Ruby 1.9, this PR falls back to the old source code without **
when a syntax error occurs.
Hi @qnighy thank you for your PR. Just a question: to avoid code duplication why you didn't use RUBY_VERSION, something like
if RUBY_VERSION < "1.9"
I18n.translate(defaults.shift, options)
else
I18n.translate(defaults.shift, **options)
end
Because in the old Ruby, SyntaxError would be raised before executing the whole if
expression.
any updates on this PR? I really need these changes.
@guillaumebesse any chance you could fix up the PR and merge it?