-
Notifications
You must be signed in to change notification settings - Fork 15
Use private_method_defined? instead of respond_to? #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class Module | ||
unless respond_to?(:ruby2_keywords, true) | ||
unless private_method_defined?(:ruby2_keywords, true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This broke this gem on Ruby 2.5:
|
||
private | ||
def ruby2_keywords(name, *) | ||
# nil | ||
|
@@ -23,12 +23,9 @@ def ruby2_keywords | |
end | ||
|
||
class Hash | ||
unless respond_to?(:ruby2_keywords_hash?) | ||
begin | ||
$VERBOSE, verbose = nil, $VERBOSE | ||
proc {|*a, **h| h}.call( | ||
ensure | ||
$VERBOSE = verbose | ||
unless method_defined?(:ruby2_keywords_hash?) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's an incorrect check BTW, there is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nobu fixed it in 51c47c0. |
||
def ruby2_keywords_hash? | ||
false | ||
end | ||
end | ||
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.
This broke this gem on Ruby 2.5: