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

Suppress keyword arguments warnings in Ruby 2.7 #342

Merged
merged 4 commits into from
Jan 13, 2020

Conversation

pocke
Copy link
Contributor

@pocke pocke commented Jan 9, 2020

It suppresses keyword arguments warnings in Ruby 2.7. And it works well with Ruby 2.8 (the master branch).

Problem

I18n-tasks displays warnings on Ruby 2.7.
I found the following warnings with bundle exec rake.

/path/to//glebm/i18n-tasks/spec/file_system_data_spec.rb:88: warning: Passing the keyword argument as the last hash parameter is deprecated
/path/to//glebm/i18n-tasks/spec/file_system_data_spec.rb:123: warning: Passing the keyword argument as the last hash parameter is deprecated
/path/to//glebm/i18n-tasks/lib/i18n/tasks/data/tree/siblings.rb:276: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to//glebm/i18n-tasks/spec/support/trees.rb:20: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to//glebm/i18n-tasks/lib/i18n/tasks/data/tree/traversal.rb:154: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/path/to//glebm/i18n-tasks/spec/support/keys_and_occurrences.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

And the test fails on Ruby 2.8.

Solution

Add ** to keyword arguments, etc.
see https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

And this pull request also enables Ruby 2.7 on Travis CI.

@glebm glebm merged commit 0ac2841 into glebm:master Jan 13, 2020
@pocke pocke deleted the ruby3-keywords branch January 14, 2020 02:03
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