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

Adds keyword arguments to configure - Ruby 3.0 support #105

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

toreym
Copy link
Contributor

@toreym toreym commented Nov 10, 2023

Background

In ruby 2.7 calling a method like configure(*@arguments) would allow for keyword arguments in a method definition like def configure(my_param:)
In Ruby 3.0, positional arguments and keyword arguments have been separated. So they must be accounted for individually

Overview of change

This PR will allow for a configure that accepts positional and keyword arguments as recommended in ruby 3. It will also account for any workflows in redis that were created with a prior version allowing for a drop-in replacement.

Potential breaking changes

  • If your workflow configure methods do not have keyword arguments then there is no impact to you. For example, unless you have a workflow with def configure(my_param:) there should be no problem using this version
  • Any workflows that are already in redis which previously had keyword args before running this version will be in the array of positional arguments in redis. This PR accounts for that by pulling any hashes from the end of the array and considers them to be a positional argument. Tests were written to account for this, however they may be edge cases in use that could still be an issue.
  • Ruby 2.7 or greater is required (keyword args are not supported as they are in 2.7 and 3.0). It may be possible to add ruby 2.6 or earlier support, however it is EOL and the effort may not be worth it.

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.

None yet

1 participant