-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
warning: method redefined #735
Comments
@pama may I ask why this was closed? I'm having the same issue right now, I'm trying to run out test suite with all warnings and so far I discovered lots of mistakes. So I'd like to make all our dependencies warning free to make it easier to spot regressions. I think a way to solve this would be to move all the I'll open a PR. |
Fix: svenfuchs#735 Whenever pluralization rules are reloaded it causes a lot of warnings: ``` lib/rails_i18n/../../rails/pluralization/ar.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/ar.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/gd.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/gd.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/hsb.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/hsb.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/lt.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/lt.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/lv.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/lv.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/mk.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/mk.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/pl.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/pl.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/sl.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/sl.rb:4: warning: previous definition of rule was here ... ``` This is mostly harmless, but annoying for users who try to run with no warnings at all.
@casperisfine can't say why, it was a while ago. |
No worries. If you are interested, #1128 would fix them. |
Fix: svenfuchs#735 Whenever pluralization rules are reloaded it causes a lot of warnings: ``` lib/rails_i18n/../../rails/pluralization/ar.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/ar.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/gd.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/gd.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/hsb.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/hsb.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/lt.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/lt.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/lv.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/lv.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/mk.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/mk.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/pl.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/pl.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/sl.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/sl.rb:4: warning: previous definition of rule was here ... ``` This is mostly harmless, but annoying for users who try to run with no warnings at all.
Fix: svenfuchs#735 Whenever pluralization rules are reloaded it causes a lot of warnings: ``` lib/rails_i18n/../../rails/pluralization/ar.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/ar.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/gd.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/gd.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/hsb.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/hsb.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/lt.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/lt.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/lv.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/lv.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/mk.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/mk.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/pl.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/pl.rb:4: warning: previous definition of rule was here lib/rails_i18n/../../rails/pluralization/sl.rb:4: warning: method redefined; discarding old rule lib/rails_i18n/../../rails/pluralization/sl.rb:4: warning: previous definition of rule was here ... ``` This is mostly harmless, but annoying for users who try to run with no warnings at all.
When running tests on a project depending on rails-i18n some warnings are raised (see below).
This is because with a recent rake (>=11.0), ruby warnings are now on by default.
What do you think about fixing those warnings as well as running the test suite with
ruby -w
(like this) ?The text was updated successfully, but these errors were encountered: