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

{Fixnum,Bignum} is deprecated on Ruby 2.4 #95

Closed
junaruga opened this issue Feb 13, 2017 · 4 comments · Fixed by #96
Closed

{Fixnum,Bignum} is deprecated on Ruby 2.4 #95

junaruga opened this issue Feb 13, 2017 · 4 comments · Fixed by #96

Comments

@junaruga
Copy link
Contributor

junaruga commented Feb 13, 2017

We may want to suppress the warnings for deprecated Fixnum/Bignum on Ruby 2.4.0.

Situation

$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]

$ bundle -v
Bundler version 1.14.3

$ rm Gemfile.lock (<= remove the `Gemfile.lock` file because tests on Ruby 2.4.0 are failed for activesupport-4 right now)

$ bundle install --path vendor/bundle

$ bundle list
Gems included by the bundle:
  * actionpack (5.0.1)
  * actionview (5.0.1)
  * activemodel (5.0.1)
  * activesupport (5.0.1)
  * builder (3.2.3)
  * bundler (1.14.3)
  * concurrent-ruby (1.0.4)
  * erubis (2.7.0)
  * globalid (0.3.7)
  * i18n (0.8.0)
  * loofah (2.0.3)
  * method_source (0.8.2)
  * mini_portile2 (2.1.0)
  * minitest (5.10.1)
  * nokogiri (1.7.0.1)
  * rack (2.0.1)
  * rack-test (0.6.3)
  * rails-dom-testing (2.0.2)
  * rails-html-sanitizer (1.0.3)
  * railties (5.0.1)
  * rake (12.0.0)
  * thor (0.19.4)
  * thread_safe (0.3.5)
  * tzinfo (1.2.2)

$ bundle exec rake test 2> test_err.log
...
127 runs, 229 assertions, 0 failures, 0 errors, 0 skips

$ grep deprecated test_err.log | grep -v 'vendor/bundle' | sort | uniq
/home/jaruga/git/globalid/test/cases/global_id_test.rb:105: warning: constant ::Fixnum is deprecated
/home/jaruga/git/globalid/test/cases/global_id_test.rb:106: warning: constant ::Fixnum is deprecated
/home/jaruga/git/globalid/test/cases/global_id_test.rb:115: warning: constant ::Bignum is deprecated
/home/jaruga/git/globalid/test/cases/global_id_test.rb:96: warning: constant ::Fixnum is deprecated
/home/jaruga/git/globalid/test/cases/global_id_test.rb:97: warning: constant ::Fixnum is deprecated

Possible Solutions

  • Change Fixnum to Integer, Bignum to Integer.
  • Change Fixnum to 0.class like rails case, rails/rails@cb0452e
  • Others
@rafaelfranca
Copy link
Member

Change Fixnum to 0.class like rails case, rails/rails@cb0452e

👍

@junaruga
Copy link
Contributor Author

@rafaelfranca yeah, but I am not sure better solution for how to change Bignum.

@rafaelfranca
Copy link
Member

We can check the ruby version and conditionally change the assertion.

@junaruga
Copy link
Contributor Author

@rafaelfranca ok let me fix it.

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 a pull request may close this issue.

2 participants