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

Separate Positional and Keyword Arguments #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cpfergus1
Copy link

@cpfergus1 cpfergus1 commented Jan 10, 2023

Add Double Splat to load_paths Call
In Ruby 3.0, positional arguments and keyword arguments were separated.
In Ruby 3, a method delegating all arguments must explicitly delegate
keyword arguments in addition to positional arguments.

In most cases, we can avoid the incompatibility by adding the double
splat operator. It explicitly specifies passing keyword arguments
instead of a Hash object.

Without this fix, applications utilizing Ruby 3+ would pass the options
hash with prependers_directories

https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

In Ruby 3.0, positional arguments and keyword arguments were separated.
In Ruby 3, a method delegating all arguments must explicitly delegate
keyword arguments in addition to positional arguments.

In most cases, we can avoid the incompatibility by adding the double
splat operator. It explicitly specifies passing keyword arguments
instead of a Hash object.

Without this fix, applications utilizing Ruby 3+ would pass the options
hash with `prependers_directories`

https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
@cpfergus1 cpfergus1 force-pushed the cpfergus1/seperate_positional_and_keyword_arguments branch from 659add2 to 56c7f0d Compare January 10, 2023 19:55
Copy link

@nachoabad nachoabad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! 👏🏽

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