From b548784b4a31b49026b69849430a9ec9072ae94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Thu, 6 Aug 2020 22:21:10 +0900 Subject: 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. --- lib/pry/code.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pry/code.rb b/lib/pry/code.rb index ad38b4f2..1fb206c4 100644 --- a/lib/pry/code.rb +++ b/lib/pry/code.rb @@ -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) -- cgit v1.2.1