Fix build error for Ruby 3.2
This commit is contained in:
parent
3e5628e3f3
commit
8d6878b496
@ -0,0 +1,12 @@
|
|||||||
|
diff -Nur a/lib/websocket/extensions/parser.rb b/lib/websocket/extensions/parser.rb
|
||||||
|
--- a/lib/websocket/extensions/parser.rb 2023-08-01 10:59:55.411703622 +0800
|
||||||
|
+++ b/lib/websocket/extensions/parser.rb 2023-08-01 10:59:46.940697645 +0800
|
||||||
|
@@ -38,7 +38,7 @@
|
||||||
|
else
|
||||||
|
data = true
|
||||||
|
end
|
||||||
|
- if data =~ NUMBER
|
||||||
|
+ if data != true and data =~ NUMBER
|
||||||
|
data = data =~ /\./ ? data.to_f : data.to_i(10)
|
||||||
|
end
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
%global gem_name websocket-extensions
|
%global gem_name websocket-extensions
|
||||||
Name: rubygem-%{gem_name}
|
Name: rubygem-%{gem_name}
|
||||||
Version: 0.1.2
|
Version: 0.1.2
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: Generic extension manager for WebSocket connections
|
Summary: Generic extension manager for WebSocket connections
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://github.com/faye/websocket-extensions-ruby
|
URL: http://github.com/faye/websocket-extensions-ruby
|
||||||
@ -9,6 +9,7 @@ Source0: https://rubygems.org/gems/websocket-extensions-%{version}.g
|
|||||||
Source1: https://github.com/faye/websocket-extensions-ruby/archive/%{version}.tar.gz
|
Source1: https://github.com/faye/websocket-extensions-ruby/archive/%{version}.tar.gz
|
||||||
Patch0: CVE-2020-7663.patch
|
Patch0: CVE-2020-7663.patch
|
||||||
Patch1: As-of-rspec-mocks-v3.10.3-mock-expectations-need-to-use.patch
|
Patch1: As-of-rspec-mocks-v3.10.3-mock-expectations-need-to-use.patch
|
||||||
|
patch2: Fix-deprecation-warning-about-being-called-on-TrueClass.patch
|
||||||
BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec)
|
BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec)
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%description
|
%description
|
||||||
@ -26,6 +27,7 @@ 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
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
gem build %{gem_name}.gemspec
|
gem build %{gem_name}.gemspec
|
||||||
@ -41,6 +43,7 @@ pushd .%{gem_instdir}
|
|||||||
tar -xzf %{SOURCE1}
|
tar -xzf %{SOURCE1}
|
||||||
cd %{gem_name}-ruby-%{version}
|
cd %{gem_name}-ruby-%{version}
|
||||||
cat %{PATCH1} | patch -p1
|
cat %{PATCH1} | patch -p1
|
||||||
|
cat %{PATCH2} | patch -p1
|
||||||
rspec spec
|
rspec spec
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@ -57,6 +60,9 @@ popd
|
|||||||
%doc %{gem_instdir}/README.md
|
%doc %{gem_instdir}/README.md
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 1 2023 liyanan <thistleslyn@163.com> - 0.1.2-4
|
||||||
|
- Fix build error for Ruby 3.2
|
||||||
|
|
||||||
* Tue Jan 17 2023 yaoxin <yaoxin30@h-partners.com> - 0.1.2-3
|
* Tue Jan 17 2023 yaoxin <yaoxin30@h-partners.com> - 0.1.2-3
|
||||||
- Fix build failed due to ruby update to 3.1.3
|
- Fix build failed due to ruby update to 3.1.3
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user