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

Get rid of deprecation warning on ruby 2.7.1 #352

Merged
merged 1 commit into from
May 31, 2020
Merged

Get rid of deprecation warning on ruby 2.7.1 #352

merged 1 commit into from
May 31, 2020

Conversation

denny
Copy link
Contributor

@denny denny commented May 31, 2020

Hi, I have no idea if I'm doing something useful here, or masking a problem that should be fixed elsewhere, or doing something even more stupid than that (Perl developer crosstraining to Ruby, sorry!) - but it does seem to make a deprecation warning go away for me so I thought I'd create a PR and let you decide.

@denny
Copy link
Contributor Author

denny commented May 31, 2020

denny@rocinante:~$ mkdir minimal_test_case
denny@rocinante:~$ mkdir minimal_test_case/app
denny@rocinante:~$ cd minimal_test_case/
denny@rocinante:~/minimal_test_case$ ruby -v
 ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
denny@rocinante:~/minimal_test_case$ gem install i18n-tasks
 # Install default configuration:
 cp $(bundle exec i18n-tasks gem-path)/templates/config/i18n-tasks.yml config/
 # Add an RSpec for missing and unused keys:
 cp $(bundle exec i18n-tasks gem-path)/templates/rspec/i18n_spec.rb spec/
 Successfully installed i18n-tasks-0.9.31
 Parsing documentation for i18n-tasks-0.9.31
 Done installing documentation for i18n-tasks after 0 seconds
 1 gem installed
denny@rocinante:~/minimal_test_case$ head -47 /home/denny/.rvm/gems/ruby-2.7.1/gems/i18n-tasks-0.9.31/lib/i18n/tasks/command/dsl.rb | tail -4
        # late-bound I18n.t for module bodies
        def t(*args)
          proc { I18n.t(*args) }
        end
denny@rocinante:~/minimal_test_case$ i18n-tasks missing
 /home/denny/.rvm/gems/ruby-2.7.1/gems/i18n-tasks-0.9.31/lib/i18n/tasks/command/dsl.rb:46: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
 /home/denny/.rvm/gems/ruby-2.7.1/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here
 ✓ Perfect! No translations are missing.
denny@rocinante:~/minimal_test_case$ i18n-tasks unused
 /home/denny/.rvm/gems/ruby-2.7.1/gems/i18n-tasks-0.9.31/lib/i18n/tasks/command/dsl.rb:46: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
 /home/denny/.rvm/gems/ruby-2.7.1/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here
 ✓ Well done! Every translation is in use.
denny@rocinante:~/minimal_test_case$ cp -f ../patched-dsl.rb /home/denny/.rvm/gems/ruby-2.7.1/gems/i18n-tasks-0.9.31/lib/i18n/tasks/command/dsl.rb
denny@rocinante:~/minimal_test_case$ head -47 /home/denny/.rvm/gems/ruby-2.7.1/gems/i18n-tasks-0.9.31/lib/i18n/tasks/command/dsl.rb | tail -4
        # late-bound I18n.t for module bodies
        def t(*args, **opts)
          proc { I18n.t(*args, **opts) }
        end
denny@rocinante:~/minimal_test_case$ i18n-tasks missing
 ✓ Perfect! No translations are missing.
denny@rocinante:~/minimal_test_case$ i18n-tasks unused
 ✓ Perfect! Every translation is in use.
denny@rocinante:~/minimal_test_case$

@glebm glebm merged commit 0d0c16b into glebm:master May 31, 2020
@glebm
Copy link
Owner

glebm commented May 31, 2020

Thanks!

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