rubygem-pry/0001-do-not-undef-unless-defined-2149.patch
2023-08-01 19:02:12 +08:00

28 lines
940 B
Diff

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?=
<shyouhei@ruby-lang.org>
Date: Thu, 6 Aug 2020 22:21:10 +0900
Subject: [PATCH] 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(-)
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)
--
2.41.0