I tried this, found rake defines Fixnum::MAX which seems useless, and submitted a PR to rake.
But it fails on ruby 2.2 or earlier, due to incompatibility of Bundler 1.13.0.
I don't mind either way.
Do you have any comment about it?
It would be nice to have constant_deprecated?.
To avoid all of these warnings while supporting <2.4 and >=2.4 i track what constants are deprecated in an array, and
then avoid using them or not by checking the array at runtime. It's bit of a pain..
I don't mind either way.
Do you have any comment about it?
It would be nice to have constant_deprecated?.
To avoid all of these warnings while supporting <2.4 and >=2.4 i track what constants are deprecated in an array, and
then avoid using them or not by checking the array at runtime. It's bit of a pain..
I realise my comment isn't clear, here's very simple code to show what i mean:
deprecated_constants = [:Fixnum, :TimeoutError, :Bignum, :FALSE, :TRUE, :NIL]
Object.constants.each do |constant|
const_get(constant) unless deprecated_constants.include?(constant)
end
the real code i have is more complex, but in essence this is the problem,
and deprecated_constants has to be maintained by me manually, which
will become out of date over time.