diff --git a/rubygem-temple-0.9.0-object-regexp-removal-ruby32.patch b/rubygem-temple-0.9.0-object-regexp-removal-ruby32.patch new file mode 100644 index 0000000..208d953 --- /dev/null +++ b/rubygem-temple-0.9.0-object-regexp-removal-ruby32.patch @@ -0,0 +1,32 @@ +From 693641fee8d1970abeded5dc59e22b745cfaf269 Mon Sep 17 00:00:00 2001 +From: Yusuke Nakamura +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 != '?' diff --git a/rubygem-temple.spec b/rubygem-temple.spec index 99e575b..bb54c52 100644 --- a/rubygem-temple.spec +++ b/rubygem-temple.spec @@ -3,7 +3,7 @@ Name: rubygem-%{gem_name} Version: 0.8.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Template compilation framework in Ruby License: MIT URL: https://github.com/judofyr/temple @@ -11,6 +11,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # Replace Erubi by Erubis. # https://github.com/judofyr/temple/pull/132 Patch0: rubygem-temple-0.8.2-Use-Erubi-instead-of-Erubis.patch +# https://github.com/judofyr/temple/pull/129 +# Ruby3.2 removes Object#=~ +Patch1: rubygem-temple-0.9.0-object-regexp-removal-ruby32.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby @@ -39,6 +42,7 @@ Documentation for %{name}. %setup -q -n %{gem_name}-%{version} %patch0 -p1 +%patch1 -p1 %build # Create the gem as gem install only works on a gem file @@ -79,6 +83,9 @@ popd %{gem_instdir}/test %changelog +* Thu Nov 24 2022 Mamoru TASAKA - 0.8.2-6 +- Backport upstream patch for ruby32 Object#=~ removal + * Sat Jul 23 2022 Fedora Release Engineering - 0.8.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild