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-1.1.3-fix-tests-Array-on-ruby-3.0.patch b/rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch new file mode 100644 index 0000000..661f88d --- /dev/null +++ b/rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch @@ -0,0 +1,38 @@ +diff --git a/test/unit/debug.rb b/test/unit/debug.rb +index 88baf56..b694f21 100644 +--- a/test/unit/debug.rb ++++ b/test/unit/debug.rb +@@ -24,7 +24,8 @@ class DebugEncoderTest < Test::Unit::TestCase + [" \n", :space], + ["[]", :method], + [:end_line, :head], +- ].flatten ++ ] ++ TEST_INPUT.flatten! + TEST_OUTPUT = <<-'DEBUG'.chomp + integer(10)operator((\\\))stringhead[ + +diff --git a/test/unit/statistic.rb b/test/unit/statistic.rb +index 1326dca..776774d 100644 +--- a/test/unit/statistic.rb ++++ b/test/unit/statistic.rb +@@ -24,7 +24,8 @@ class StatisticEncoderTest < Test::Unit::TestCase + [" \n", :space], + ["[]", :method], + [:end_line, :test], +- ].flatten ++ ] ++ TEST_INPUT.flatten! + TEST_OUTPUT = <<-'DEBUG' + + Code Statistics +@@ -56,4 +57,4 @@ Token Types (7): + assert_equal TEST_OUTPUT, TEST_INPUT.statistic + end + +-end +\ No newline at end of file ++end +-- +2.29.2 + diff --git a/rubygem-coderay.spec b/rubygem-coderay.spec index 4280424..150b819 100644 --- a/rubygem-coderay.spec +++ b/rubygem-coderay.spec @@ -1,17 +1,21 @@ %global gem_name coderay Name: rubygem-%{gem_name} -Version: 1.1.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 +# 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. @@ -25,7 +29,11 @@ BuildArch: noarch Documentation for %{name}. %prep -%autosetup -n %{gem_name}-%{version} -p1 +%setup -q -n %{gem_name}-%{version} -b 1 + +pushd .. +%patch0 -p1 +popd %build gem build ../%{gem_name}-%{version}.gemspec @@ -42,12 +50,25 @@ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x %check pushd .%{gem_instdir} -tar xzvf %{SOURCE1} +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 @@ -64,5 +85,8 @@ popd %doc %{gem_instdir}/README_INDEX.rdoc %changelog +* Mon Feb 14 2022 yaoxin - 1.1.3-1 +- Upgrade rubygem-coderay to 1.1.3 to resolve compilation failures. + * Sat Jul 25 2020 wangxiao - 1.1.2-1 - package init