diff --git a/coderay-1.1.2.gem b/coderay-1.1.2.gem deleted file mode 100644 index 5d698f1..0000000 Binary files a/coderay-1.1.2.gem and /dev/null differ diff --git a/coderay-1.1.2.tar.gz b/coderay-1.1.2.tar.gz deleted file mode 100644 index 14c052e..0000000 Binary files a/coderay-1.1.2.tar.gz and /dev/null differ diff --git a/coderay-1.1.3-tests.txz b/coderay-1.1.3-tests.txz new file mode 100644 index 0000000..6cf95e3 Binary files /dev/null and b/coderay-1.1.3-tests.txz differ diff --git a/coderay-1.1.3.gem b/coderay-1.1.3.gem new file mode 100644 index 0000000..3475820 Binary files /dev/null and b/coderay-1.1.3.gem differ diff --git a/coderay-1.1.3.tar.gz b/coderay-1.1.3.tar.gz new file mode 100644 index 0000000..1850f5b Binary files /dev/null and b/coderay-1.1.3.tar.gz differ diff --git a/rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch b/rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch deleted file mode 100644 index 5813420..0000000 --- a/rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch +++ /dev/null @@ -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 diff --git a/rubygem-coderay.spec b/rubygem-coderay.spec index ac6592b..11db3f3 100644 --- a/rubygem-coderay.spec +++ b/rubygem-coderay.spec @@ -1,18 +1,21 @@ %global gem_name coderay Name: rubygem-%{gem_name} -Version: 1.1.2 -Release: 2 +Version: 1.1.3 +Release: 1 Summary: Fast syntax highlighting for selected languages License: MIT URL: http://coderay.rubychan.de 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 -# Remove extended Tokens#filter for Ruby 2.6 compatibility. -# https://github.com/rubychan/coderay/pull/233 -Patch0000: rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch -Patch0001: rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch +# git clone https://github.com/rubychan/coderay --no-checkout +# cd coderay && git archive -v -o coderay-1.1.3-tests.txz v1.1.3 test spec +Source1: %{gem_name}-%{version}-tests.txz +Source2: https://github.com/rubychan/coderay/archive/refs/tags/v1.1.3.tar.gz#/%{gem_name}-%{version}.tar.gz +# 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: rubygem(rspec) BuildArch: noarch %description Fast and easy syntax highlighting for selected languages, written in Ruby. @@ -26,8 +29,11 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -n %{gem_name}-%{version} -%patch0000 -p1 +%setup -q -n %{gem_name}-%{version} -b 1 + +pushd .. +%patch0 -p1 +popd %build gem build ../%{gem_name}-%{version}.gemspec @@ -44,15 +50,25 @@ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x %check pushd .%{gem_instdir} -tar xzvf %{SOURCE1} -pushd ./%{gem_name}-%{version}/ -patch -p1 < %_sourcedir/rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch -popd +cp -r %{_builddir}/spec . +cp -r %{_builddir}/test . + +# 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 LANG=C.UTF-8 -ruby ./%{gem_name}-%{version}/test/functional/suite.rb -ruby ./%{gem_name}-%{version}/test/functional/for_redcloth.rb -ruby ./%{gem_name}-%{version}/test/unit/suite.rb +ruby ./test/functional/suite.rb +ruby ./test/functional/for_redcloth.rb +ruby ./test/unit/suite.rb +rspec spec popd %files @@ -69,6 +85,9 @@ popd %doc %{gem_instdir}/README_INDEX.rdoc %changelog +* Fri Oct 21 2022 caodongxia - 1.1.3-1 +- update to 1.1.3 + * Sat Feb 19 2022 houyingchao - 1.1.2-2 - Fix the compilation failure