!5 Update to 1.1.3

From: @caodongxia 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2022-10-24 02:15:23 +00:00 committed by Gitee
commit ddb205540c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 35 additions and 30 deletions

Binary file not shown.

Binary file not shown.

BIN
coderay-1.1.3-tests.txz Normal file

Binary file not shown.

BIN
coderay-1.1.3.gem Normal file

Binary file not shown.

BIN
coderay-1.1.3.tar.gz Normal file

Binary file not shown.

View File

@ -1,14 +0,0 @@
diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb
index e7bffce2..b5f78e71 100644
--- a/lib/coderay/tokens.rb
+++ b/lib/coderay/tokens.rb
@@ -39,6 +39,9 @@ module CodeRay
# You can serialize it to a JSON string and store it in a database, pass it
# around to encode it more than once, send it to other algorithms...
class Tokens < Array
+ # Remove Array#filter that is a new alias for Array#select on Ruby 2.6,
+ # for method_missing called with filter method.
+ undef_method :filter if instance_methods.include?(:filter)
# The Scanner instance that created the tokens.
attr_accessor :scanner

View File

@ -1,18 +1,21 @@
%global gem_name coderay %global gem_name coderay
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 1.1.2 Version: 1.1.3
Release: 2 Release: 1
Summary: Fast syntax highlighting for selected languages Summary: Fast syntax highlighting for selected languages
License: MIT License: MIT
URL: http://coderay.rubychan.de URL: http://coderay.rubychan.de
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/rubychan/coderay/archive/v1.1.2.tar.gz#/%{gem_name}-%{version}.tar.gz # git clone https://github.com/rubychan/coderay --no-checkout
# Remove extended Tokens#filter for Ruby 2.6 compatibility. # cd coderay && git archive -v -o coderay-1.1.3-tests.txz v1.1.3 test spec
# https://github.com/rubychan/coderay/pull/233 Source1: %{gem_name}-%{version}-tests.txz
Patch0000: rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch Source2: https://github.com/rubychan/coderay/archive/refs/tags/v1.1.3.tar.gz#/%{gem_name}-%{version}.tar.gz
Patch0001: rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch # Fix test suite for ruby 3.0 change for methods on subclass of Array
# https://github.com/rubychan/coderay/pull/255
Patch0000: rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch
BuildRequires: ruby(release) rubygems-devel ruby >= 1.8.6 rubygem(test-unit) BuildRequires: ruby(release) rubygems-devel ruby >= 1.8.6 rubygem(test-unit)
BuildRequires: rubygem(rspec)
BuildArch: noarch BuildArch: noarch
%description %description
Fast and easy syntax highlighting for selected languages, written in Ruby. Fast and easy syntax highlighting for selected languages, written in Ruby.
@ -26,8 +29,11 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%prep %prep
%setup -n %{gem_name}-%{version} %setup -q -n %{gem_name}-%{version} -b 1
%patch0000 -p1
pushd ..
%patch0 -p1
popd
%build %build
gem build ../%{gem_name}-%{version}.gemspec gem build ../%{gem_name}-%{version}.gemspec
@ -44,15 +50,25 @@ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
%check %check
pushd .%{gem_instdir} pushd .%{gem_instdir}
tar xzvf %{SOURCE1} cp -r %{_builddir}/spec .
pushd ./%{gem_name}-%{version}/ cp -r %{_builddir}/test .
patch -p1 < %_sourcedir/rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch
popd # Comment out simplecov.
for file in \
spec/spec_helper.rb \
test/executable/suite.rb \
test/functional/for_redcloth.rb \
test/functional/suite.rb \
test/unit/suite.rb; do
sed -i "/^require 'simplecov'/ s/^/#/" "${file}"
done
# See https://github.com/rubychan/coderay/blob/master/rake_tasks/test.rake # See https://github.com/rubychan/coderay/blob/master/rake_tasks/test.rake
LANG=C.UTF-8 LANG=C.UTF-8
ruby ./%{gem_name}-%{version}/test/functional/suite.rb ruby ./test/functional/suite.rb
ruby ./%{gem_name}-%{version}/test/functional/for_redcloth.rb ruby ./test/functional/for_redcloth.rb
ruby ./%{gem_name}-%{version}/test/unit/suite.rb ruby ./test/unit/suite.rb
rspec spec
popd popd
%files %files
@ -69,6 +85,9 @@ popd
%doc %{gem_instdir}/README_INDEX.rdoc %doc %{gem_instdir}/README_INDEX.rdoc
%changelog %changelog
* Fri Oct 21 2022 caodongxia <caodongxia@h-partners.com> - 1.1.3-1
- update to 1.1.3
* Sat Feb 19 2022 houyingchao <houyingchao@huawei.com> - 1.1.2-2 * Sat Feb 19 2022 houyingchao <houyingchao@huawei.com> - 1.1.2-2
- Fix the compilation failure - Fix the compilation failure