nesquena / backburner

Simple and reliable beanstalkd job queue for ruby
http://nesquena.github.com/backburner
MIT License
428 stars 68 forks source link

⚠ constant ::Fixnum is deprecated #140

Closed amatsuda closed 7 years ago

amatsuda commented 7 years ago

Fixnum and Bignum has been unified into Integer, and so it warns since Ruby 2.4. see: http://www.a-k-r.org/pub/2016-09-08-rubykaigi-unified-integer.pdf

nesquena commented 7 years ago

Thanks! How does merging this affect Backburner on older versions of Ruby pre 2.4?

amatsuda commented 7 years ago

Uh, I'm sorry, I should have explained a little bit more. This may not be a big problem here, but since Ruby 2.4+ regards both Fixnum and Bignum as Integer, this patch actually introduces a slight incompatibility. See the following code that demonstrates how a very big number is treated.

p 1.is_a?(Fixnum) && 1.is_a?(Integer)
p (10 ** 20).is_a?(Fixnum) && (10 ** 20).is_a?(Integer)

ruby 2.4, 2.5

fixnum_integer.rb:1: warning: constant ::Fixnum is deprecated true fixnum_integer.rb:2: warning: constant ::Fixnum is deprecated true

older rubies (I tested back to ruby 1.8.7)

true false

So, when a very big number is given as pri or ttr, the behavior used to be different between Ruby versions, but that situation is fixed now. This is the only side effect of this patch.

nesquena commented 7 years ago

Thanks!