-
Notifications
You must be signed in to change notification settings - Fork 0
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
Preserve Ruby 2.7 behavior for Ruby keyword args #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one 👍, can we bump to 0.14.1
?
@ronanduddy No need to. We haven't released 0.14.0 yet. Just because code is in So basically once this merges, 0.14.0 will be done. I'll get the tag created, and then open a PR to install 0.14.0 on Panacea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah got you @Jonic - I just checked Panacea's Gemfile:
gem "rectify", "~> 0.13", github: "healiosuk/rectify", tag: "v0.13.0"
LGTM
Applies
ruby2_keywords
to theCommand.call
method, which preserves the Ruby 2.7 behavior for keyword args.The result of these changes is that Rectify will continue to work with the existing behavior for keyword args once we've upgraded Panacea to Ruby 3. We've had to take this approach because fixing it would have also required us to upgrade Rectify to only work on Ruby
>= 3.0
. This is due to the fact that our particular use of kwargs in the Command pattern are considered a "corner case", preventing us from adopting the new behavior in our Ruby 2.7 code.See: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ - search this page for the string "If your code doesn’t have to run on Ruby 2.6 or older"
So what does all this mean?
In short, we don't have to worry about Rectify anymore. Once this has merged, we've released 0.14.0, and we've updated Panacea to use this new version, our existing use of Rectify Commands will continue to work even after we've upgraded the application to run on Ruby 3.0.
This allows us to almost forget about the old Rectify-powered commands, and begin thinking about what tool or pattern we introduce to replace Rectify.