-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fix deprecated warnings in Ruby 2.4.0+ #36
Conversation
@@ -28,7 +28,7 @@ def initialize(*args) | |||
unless Diff::LCS::Change.valid_action?(@action) | |||
raise "Invalid Change Action '#{@action}'" | |||
end | |||
raise "Invalid Position Type" unless @position.kind_of? Fixnum | |||
raise "Invalid Position Type" unless @position.kind_of? Integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather see this in the same way that I saw a different fix in minitest;
class Diff::LCS::Change
IntClass = 1.class # :nodoc:
…
raise "Invalid Position Type" unless @position.kind_of? IntClass
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. It seems to me that it is used when we want to change behavior in 2.4 and 2.3 or lower.
However, Object#kind_of? (NOT Object#instance_of?) has been used here. Therefore, I think that it is better to use Integer
as it is. Integer
is a super class of Fixnum
, so I think that is simple here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @halostatue, could you reply for above @koic comment?
I really hope that this issue is fixed, and bumped (released), because this is one of the reason that cucumber
is not supported on Ruby 2.4.
Thank you.
- Updated testing and gem infrastructure. - Cleaning up documentation. - Modernizing specs. - Silence Ruby 2.4 Fixnum deprecation warnings. Fixes #36, #38. - Ensure test dependencies are loaded. Fixes #33, #34 so that specs can be run independently. - Fix issue #1 with incorrect intuition of patch direction. Tentative fix, but the failure cases pass now.
Ruby 2.4.0 unifies Fixnum and Bignum into Integer.
https://bugs.ruby-lang.org/issues/12005
Fix following deprecated warnings in Ruby 2.4.0-preview3.
warning: constant ::Fixnum is deprecated
Thanks.