calebhearth / formulaic

Simplify form filling with Capybara

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uses deprecated Fixnum constant

mike-burns opened this issue · comments

The Fixnum constant is deprecated in Ruby 2.4, to be replaced with Integer. This causes a warning to be printed:

/home/mike/.gem/ruby/2.4.0/gems/formulaic-0.3.0/lib/formulaic/form.rb:11: warning: constant ::Fixnum is deprecated

Let's find a way to silence that warning.

We can use Integer instead of Fixnum and all will work as desired.

~% ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
~% irb    
irb(main):001:0> 1.is_a?(Integer)
=> true
irb(main):002:0> 1.class
=> Fixnum
~% ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
~% irb
irb(main):001:0> 1.is_a?(Integer)
=> true
irb(main):002:0> 1.class
=> Integer

Verified all the way back to 2.0.0

I saw this yesterday. Thought it was Rails' fault.