1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

do not undef =~ unless defined (#2149)

Undefining a nonexistent definition is an error in Ruby.  This has not been a problem because there always was `Object#=~` predefined.  But we are planning to delete that useless method.  This would become an error unless properly guarded.
This commit is contained in:
卜部昌平 2020-08-06 22:21:10 +09:00 committed by GitHub
parent 9d9ae4a0b0
commit b548784b4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,7 +339,7 @@ class Pry
super
end
end
undef =~
undef =~ if method_defined?(:=~)
# Check whether String responds to missing methods.
def respond_to_missing?(method_name, include_private = false)