fix build error for ruby upgrade to 3.2.2

This commit is contained in:
chen-jan 2023-08-01 11:40:17 +08:00
parent a5227cb7c0
commit 7bee4a655c
3 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,23 @@
From 94432675ed3bc75af66c412ddf5fc658084448ec Mon Sep 17 00:00:00 2001
From: Peter Goldstein <peter.m.goldstein@gmail.com>
Date: Tue, 18 Jan 2022 00:53:13 -0800
Subject: [PATCH] Add Ruby 3.1 and ruby-head to CI and fix undef that fails on
ruby-head
---
.github/workflows/actions.yml | 2 +-
lib/fakefs/pathname.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/fakefs/pathname.rb b/lib/fakefs/pathname.rb
index 5398494..120aa74 100644
--- a/lib/fakefs/pathname.rb
+++ b/lib/fakefs/pathname.rb
@@ -1035,6 +1035,6 @@ def empty?
# Pathname class
class Pathname
- undef =~
+ undef =~ if respond_to?(:=~)
end
end

View File

@ -0,0 +1,25 @@
From b73f5b7b4fb4b5f436570c91214356487224e7df Mon Sep 17 00:00:00 2001
From: Michael Grosser <michael@grosser.it>
Date: Sun, 13 Nov 2022 21:31:04 -0800
Subject: [PATCH 1/2] fix 3.2 bug
---
test/fakefs_test.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb
index 4873d0f..71c68b8 100644
--- a/test/fakefs_test.rb
+++ b/test/fakefs_test.rb
@@ -2031,7 +2031,8 @@ def test_should_set_pos_with_tell_method
# omit methods from io/wait
:nread, :pwrite, :pread,
:ready?,
- :wait, :wait_readable, :wait_writable
+ :wait, :wait_readable, :wait_writable, :wait_priority,
+ :timeout, :timeout=
].freeze
OMITTED_JRUBY_FILE_METHODS = [

View File

@ -2,7 +2,7 @@
Name: rubygem-%{gem_name}
Version: 1.2.2
Release: 1
Release: 2
Summary: A fake filesystem. Use it in your tests
License: MIT
URL: https://github.com/fakefs/fakefs
@ -11,6 +11,13 @@ Source1: https://github.com/fakefs/fakefs/archive/v%{version}/fakefs
# Skip test of methods introduced in Ruby 2.5.
# https://github.com/fakefs/fakefs/issues/390
# From https://github.com/fakefs/fakefs/pull/467
# ruby3.2 does not respond to Pathname#=~
Patch0: rubygem-fakefs-1.4.1-regexmatch-for-pathname-ruby32.patch
# From https://github.com/fakefs/fakefs/pull/480
# Test suite needs more filtering for ruby3.2
Patch1: rubygem-fakefs-1.9.0-ruby32-testsuite.patch
BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec) rubygem(minitest)
BuildArch: noarch
@ -27,6 +34,11 @@ Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1
%patch0 -p1
cd %{_builddir}/test
%patch1 -p2
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
@ -57,7 +69,11 @@ popd
%doc %{gem_instdir}/README.md
%changelog
* Tue Aug 01 2023 chenchen <chen_aka_jan@163.com> - 1.2.2-2
- fix build error for ruby upgrade to 3.2.2
* Thu Feb 10 2022 zhangtao <zhangtao221@huawei.com> - 1.2.2-1
- package update to 1.2.2
* Thu Jul 30 2020 maminjie <maminjie1@huawei.com> - 0.13.1-1
- package init