!6 fix build error for ruby upgrade to 3.2.2

From: @chen-jan 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
This commit is contained in:
openeuler-ci-bot 2023-08-01 10:44:24 +00:00 committed by Gitee
commit 5e97cedc04
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,27 @@
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

View File

@ -1,7 +1,7 @@
%global gem_name pry %global gem_name pry
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 0.13.1 Version: 0.13.1
Release: 1 Release: 2
Summary: An IRB alternative and runtime developer console Summary: An IRB alternative and runtime developer console
License: MIT License: MIT
URL: https://rubygems.org/gems/pry URL: https://rubygems.org/gems/pry
@ -17,6 +17,7 @@ Requires: rubygem(method_source) < 0.9
%endif %endif
BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec) rubygem(coderay) => 1.1.0 BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec) rubygem(coderay) => 1.1.0
BuildRequires: rubygem(slop) => 3.4 rubygem(method_source) => 0.8.1 vi rubygem(bundler) BuildRequires: rubygem(slop) => 3.4 rubygem(method_source) => 0.8.1 vi rubygem(bundler)
Patch001: 0001-do-not-undef-unless-defined-2149.patch
BuildArch: noarch BuildArch: noarch
%if 0%{?fc19} || 0%{?fc20} || 0%{?el7} %if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version} Provides: rubygem(%{gem_name}) = %{version}
@ -35,6 +36,7 @@ Documentation for %{name}.
gem unpack %{SOURCE0} gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version} %setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%patch001 -p1
%build %build
gem build %{gem_name}.gemspec gem build %{gem_name}.gemspec
@ -75,6 +77,9 @@ popd
%doc %{gem_instdir}/README.md %doc %{gem_instdir}/README.md
%changelog %changelog
* Tue Aug 01 2023 chenchen <chen_aka_jan@163.com> - 0.13.1-2
- fix build error for ruby upgrade to 3.2.2
* Mon Feb 21 2022 houyingchao <houyingchao@huawei.com> - 0.13.1-1 * Mon Feb 21 2022 houyingchao <houyingchao@huawei.com> - 0.13.1-1
- Upgrade to 0.13.1 version - Upgrade to 0.13.1 version