Skip to content

Separate Positional and Keyword Arguments - #13

Open
cpfergus1 wants to merge 1 commit into
nebulab:masterfrom
cpfergus1:cpfergus1/seperate_positional_and_keyword_arguments
Open

Separate Positional and Keyword Arguments#13
cpfergus1 wants to merge 1 commit into
nebulab:masterfrom
cpfergus1:cpfergus1/seperate_positional_and_keyword_arguments

Conversation

@cpfergus1

@cpfergus1 cpfergus1 commented Jan 10, 2023

Copy link
Copy Markdown

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
@cpfergus1
cpfergus1 requested a review from aldesantis January 10, 2023 20:23

@nachoabad nachoabad left a comment

Copy link
Copy Markdown

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