-
Notifications
You must be signed in to change notification settings - Fork 103
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
Updated for Ruby 2.4 Support #301
Updated for Ruby 2.4 Support #301
Conversation
@@ -59,7 +59,7 @@ def add(var, val) | |||
end | |||
|
|||
def remove(idx) | |||
if (idx.class == ::Fixnum) | |||
if idx.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.
Prefer Object#is_a? over Object#kind_of?.
@@ -36,7 +36,7 @@ def to_s | |||
end | |||
|
|||
def find(idx) | |||
if (idx.class == ::Fixnum) | |||
if idx.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.
Prefer Object#is_a? over Object#kind_of?.
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 think these methods do the exact same thing and I have no preference on which one to use. I could not find a definitive answer on which one is "more correct" with a quick search. Since this is just a port of changes from upstream rex-mime project, I am okay ignoring hound in this case.
@twosevenzero i'm fine with this, and routes to a handful of fixes/updates we need to include for Ruby2.4 I'm going to create a new branch to target and merge your PR into there. Thanks again for this PR, and look forward to that branch removing any/most deprecation warnings. |
Description
::Fixnum is deprecated in Ruby 2.4. Updated with kind_of?(Integer).
Motivation and Context
Just a minor update to stop warnings for deprecated features.
How Has This Been Tested?
Ported the changes from the rapid7/rex-mime project.
Types of changes