Skip to content

Commit

Permalink
do not undef =~ unless defined (#2149)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shyouhei committed Aug 6, 2020
1 parent 9d9ae4a commit b548784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pry/code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def method_missing(method_name, *args, &block)
super
end
end
undef =~
undef =~ if method_defined?(:=~)

# Check whether String responds to missing methods.
def respond_to_missing?(method_name, include_private = false)
Expand Down

0 comments on commit b548784

Please sign in to comment.