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

Fix Ruby 2.7 keyword arguments warnings #74

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

Conversation

pocke
Copy link

@pocke pocke commented Aug 15, 2020

This pull request resolves Ruby 2.7 keyword argument warnings.

The warnings are introduced since Ruby 2.7. In short, we need to keyword splat operator (**) to use a hash as keyword arguments.
details: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

We can confirm the warning from this repository with the test cases.

$ bundle exec rake
# Running:

............../path/to/origami/lib/origami/filters/predictors.rb:65: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to/origami/lib/origami/filters/predictors.rb:83: warning: The called method `apply_pre_prediction' is defined here
/path/to/origami/lib/origami/filters/predictors.rb:71: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to/origami/lib/origami/filters/predictors.rb:102: warning: The called method `apply_post_prediction' is defined here
................/path/to/origami/lib/origami/string.rb:440: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to/origami/lib/origami/string.rb:377: warning: The called method `initialize' is defined here
/path/to/origami/lib/origami/string.rb:420: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to/origami/lib/origami/string.rb:377: warning: The called method `initialize' is defined here
.......................

Finished in 0.556607s, 95.2198 runs/s, 767.1480 assertions/s.

53 runs, 427 assertions, 0 failures, 0 errors, 0 skips

And this pull request fixes all of them.

@ndbroadbent
Copy link

@gdelugre Sorry to bother you, but would it be possible to merge this PR and release a new version to fix the warnings?

My company is also actively using this gem, so I would be happy to help with maintaining it if you are looking for some help

@UniqueTokens
Copy link

Related: Ruby 3.0 & origami (2.1.0): Origami::Date.now throws ArgumentError #80

@corwinstephen
Copy link

@gdelugre seems to have completely disappeared. It may be worth officially migrating to a fork of this gem

@krtschmr
Copy link

so - shall we fork?

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.

7 participants