Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
f42ed736fe
!10 fix regex_match error and build fail
From: @bizhiyuan 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
2023-08-14 08:46:00 +00:00
bizhiyuan
73e0b4570f fix regex_match error and build fail 2023-08-14 16:27:44 +08:00
openeuler-ci-bot
ce7ad13747
!6 [sync] PR-4: update to 1.1.1
From: @openeuler-sync-bot 
Reviewed-by: @shinwell_hu 
Signed-off-by: @shinwell_hu
2022-03-30 08:37:17 +00:00
lyn1001
eea2031676 update to 1.1.1
(cherry picked from commit c29d70c5378861412b3a4f16dfadf8f6e914b18a)
2022-03-23 14:13:48 +08:00
openeuler-ci-bot
26f12acbac !3 yaml fix
From: @gyn_emma
Reviewed-by: @shinwell_hu
Signed-off-by: @shinwell_hu
2021-07-27 01:16:34 +00:00
GYN
31386c073c update rubygem-mustermann.yaml. 2020-10-10 14:11:26 +08:00
openeuler-ci-bot
9fb7582796 !2 Fix build fail
Merge pull request !2 from lyn/master
2020-09-08 14:54:49 +08:00
lyn1001
994c757169 fix build fail 2020-09-08 14:38:48 +08:00
openeuler-ci-bot
a81ef9b9a3 !1 package init
Merge pull request !1 from GYN/master
2020-09-01 09:57:15 +08:00
GYN
274e09501b 1 2020-08-28 16:38:19 +08:00
7 changed files with 146 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,27 @@
From 82d5efc5796e8e4864e495da6280c6edd7d09375 Mon Sep 17 00:00:00 2001
From: Olle Jonsson <olle.jonsson@gmail.com>
Date: Thu, 17 Dec 2020 14:10:06 +0100
Subject: [PATCH] Avoid "deprecated Object#=~ is called on Integer"
In a test suite I was using, I saw this warning printed liberally:
warning: deprecated Object#=~ is called on Integer; it always returns nil
Change inspired by the same kind of fix here: https://github.com/rails/rails/commit/eafff15a023670974bd71efaec51e4c80364b95d
---
mustermann/lib/mustermann/ast/translator.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mustermann/lib/mustermann/ast/translator.rb b/mustermann/lib/mustermann/ast/translator.rb
index 596e362..87b90c7 100644
--- a/mustermann/lib/mustermann/ast/translator.rb
+++ b/mustermann/lib/mustermann/ast/translator.rb
@@ -120,7 +120,7 @@ def decorator_for(node)
# @!visibility private
def escape(char, parser: URI::DEFAULT_PARSER, escape: parser.regexp[:UNSAFE], also_escape: nil)
escape = Regexp.union(also_escape, escape) if also_escape
- char =~ escape ? parser.escape(char, Regexp.union(*escape)) : char
+ char.to_s =~ escape ? parser.escape(char, Regexp.union(*escape)) : char
end
end
end

Binary file not shown.

BIN
mustermann-1.1.1.gem Normal file

Binary file not shown.

View File

@ -0,0 +1,23 @@
From 8be5bd4ac3642d9c9582d0a7258f3197fa54bb96 Mon Sep 17 00:00:00 2001
From: Paul Padier <paul.padier@outlook.com>
Date: Wed, 20 Jul 2022 22:32:25 +0900
Subject: [PATCH] Don't call #=~ on objects that don't respond to it
`Kernel` defined `#=~` up until Ruby 3.2, but it just returned `nil` when the method wasn't redefined by a child class.
---
mustermann/lib/mustermann/ast/expander.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mustermann/lib/mustermann/ast/expander.rb b/mustermann/lib/mustermann/ast/expander.rb
index 6cb9110..f5ca874 100644
--- a/mustermann/lib/mustermann/ast/expander.rb
+++ b/mustermann/lib/mustermann/ast/expander.rb
@@ -124,6 +124,8 @@ def error_for(values)
# @see Mustermann::AST::Translator#expand
# @!visibility private
ruby2_keywords def escape(string, *args)
+ return super unless string.respond_to?(:=~)
+
# URI::Parser is pretty slow, let's not send every string to it, even if it's unnecessary
string =~ /\A\w*\Z/ ? string : super
end

92
rubygem-mustermann.spec Normal file
View File

@ -0,0 +1,92 @@
%global gem_name mustermann
%{?_with_bootstrap: %global bootstrap 1}
Name: rubygem-%{gem_name}
Version: 1.1.1
Release: 2
Summary: Your personal string matching expert
License: MIT
URL: https://github.com/sinatra/mustermann
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Support and mustermann-contrib routines required by test suite.
# git clone https://github.com/sinatra/mustermann.git && cd mustermann
# git checkout v1.1.1 && tar czvf mustermann-1.1.1-support.tgz support/
Source1: %{gem_name}-%{version}-support.tgz
# tar czvf mustermann-1.1.1-mustermann-contrib.tgz mustermann-contrib/
Source2: %{gem_name}-%{version}-mustermann-contrib.tgz
Patch0: %{gem_name}-2.0.2-ruby32-regex_match-for-object.patch
# Similarly, from https://github.com/sinatra/mustermann/pull/113
Patch1: %{gem_name}-1.1.1-ruby32-regex_match-for-object-2.patch
BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.0 rubygem(rspec) rubygem(rspec-its)
%if ! 0%{?bootstrap}
BuildRequires: rubygem(sinatra)
%endif
BuildRequires: rubygem(rack-test)
BuildArch: noarch
%description
A library implementing patterns that behave like regular expressions.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1 -b 2
%patch0 -p2
%patch1 -p2
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%if ! 0%{?bootstrap}
%check
sed -i "/^require 'tool\/warning_filter'/ s/^/#/" \
%{_builddir}/support/lib/support/env.rb
sed -i "/^require 'support\/coverage'/ s/^/#/" \
%{_builddir}/support/lib/support.rb
pushd .%{gem_instdir}
mv spec/extension_spec.rb{,.disabled}
sed -i "/^require 'mustermann\/extension'/ s/^/#/" \
spec/mustermann_spec.rb
sed -i '/^ describe :extend_object do$/,/^ end$/ s/^/#/' \
spec/mustermann_spec.rb
rspec -I%{_builddir}/{support,mustermann-contrib}/lib spec
popd
%endif
%files
%dir %{gem_instdir}
%license %{gem_instdir}/LICENSE
%{gem_libdir}
%exclude %{gem_instdir}/mustermann.gemspec
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%{gem_instdir}/bench
%{gem_instdir}/spec
%changelog
* Mon Aug 14 2023 bizhiyuan <bizhiyuan@kylinos.cn> - 1.1.1-2
- fix regex_match error and build fail
* Thu Feb 24 2022 liyanan <liyanan32@huawei.com> - 1.1.1-1
- update to 1.1.1
* Tue Sep 8 2020 yanan li <liyanan032@huawei.com> - 1.0.2-2
- fix build fail
* Wed Aug 19 2020 geyanan <geyanan2@huawei.com> - 1.0.2-1
- package init

4
rubygem-mustermann.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: sinatra/mustermann
tag_prefix: "v"
seperator: "."