fix build error with ruby3.2
(cherry picked from commit 0bc395b558ae216d4bad969056ed1669b5674e32)
This commit is contained in:
parent
7b6713f6fc
commit
88b435ee5d
33
rubygem-temple-0.8.0-object-regexp-removal-ruby32.patch
Normal file
33
rubygem-temple-0.8.0-object-regexp-removal-ruby32.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 693641fee8d1970abeded5dc59e22b745cfaf269 Mon Sep 17 00:00:00 2001
|
||||
From: Yusuke Nakamura <yusuke1994525@gmail.com>
|
||||
Date: Fri, 10 Jan 2020 01:06:06 +0900
|
||||
Subject: [PATCH] Suppress deprecated warning by Object#=~ since ruby 2.6
|
||||
|
||||
In `Temple::Mixins::GrammerDSL::Value#Rule`, call `=~` method to
|
||||
`Class` class then that causes a warning message.
|
||||
This behavior introduced from ruby 2.6 with `-W` option.
|
||||
(And ruby 2.7 always show a warning message)
|
||||
|
||||
- https://bugs.ruby-lang.org/issues/15231
|
||||
- https://github.com/ruby/ruby/commit/ebff9dc10
|
||||
|
||||
Therefore use case-when-else clause to avoid warning.
|
||||
---
|
||||
lib/temple/mixins/grammar_dsl.rb | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/temple/mixins/grammar_dsl.rb b/lib/temple/mixins/grammar_dsl.rb
|
||||
index 0f154f5..d02aa9c 100644
|
||||
--- a/lib/temple/mixins/grammar_dsl.rb
|
||||
+++ b/lib/temple/mixins/grammar_dsl.rb
|
||||
@@ -143,7 +143,8 @@ def Rule(rule)
|
||||
start = Or.new(self)
|
||||
curr = [start]
|
||||
rule.each do |elem|
|
||||
- if elem =~ /^(.*)(\*|\?|\+)$/
|
||||
+ case elem
|
||||
+ when /^(.*)(\*|\?|\+)$/
|
||||
elem = Element.new(self, const_get($1))
|
||||
curr.each {|c| c << elem }
|
||||
elem << elem if $2 != '?'
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
%global gem_name temple
|
||||
Name: rubygem-%{gem_name}
|
||||
Version: 0.8.0
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: Template compilation framework in Ruby
|
||||
License: MIT
|
||||
URL: https://github.com/judofyr/temple
|
||||
Source0: https://rubygems.org/gems/temple-%{version}.gem
|
||||
Patch0: rubygem-temple-0.8.2-Use-Erubi-instead-of-Erubis.patch
|
||||
Patch1: rubygem-temple-0.8.0-object-regexp-removal-ruby32.patch
|
||||
BuildRequires: ruby(release) rubygems-devel ruby rubygem-bacon rubygem(erubi) rubygem(tilt)
|
||||
BuildArch: noarch
|
||||
%description
|
||||
@ -29,6 +30,7 @@ Documentation for %{name}.
|
||||
%setup -q -n %{gem_name}-%{version}
|
||||
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
gem build ../%{gem_name}-%{version}.gemspec
|
||||
@ -64,6 +66,9 @@ popd
|
||||
%{gem_instdir}/test
|
||||
|
||||
%changelog
|
||||
* Mon Aug 14 2023 liyanan <thistleslyn@163.com> - 0.8.0-3
|
||||
- fix build error with ruby3.2
|
||||
|
||||
* Tue Jan 10 liyanan <liyanan32@h-partners.com> - 0.8.0-2
|
||||
- Use Erubi instead of Erubis
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user