From 9dc3962871737c5d04dd3e27c004a0a1a8baba00 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Thu, 14 Feb 2019 17:56:01 +0100 Subject: [PATCH] Remove extended Tokens#filter for Ruby 2.6 compatibility. --- ...ay-1.1.2-remove-Array-filter-for-ruby-2.6.patch | 14 ++++++++++++++ rubygem-coderay.spec | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch 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 new file mode 100644 index 0000000..5813420 --- /dev/null +++ b/rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch @@ -0,0 +1,14 @@ +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 c40d3ae..efe61b9 100644 --- a/rubygem-coderay.spec +++ b/rubygem-coderay.spec @@ -2,7 +2,7 @@ Name: rubygem-%{gem_name} Version: 1.1.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Fast syntax highlighting for selected languages License: MIT URL: http://coderay.rubychan.de @@ -10,6 +10,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # git clone https://github.com/rubychan/coderay.git && cd coderay # git checkout v1.1.2 && tar czvf coderay-1.1.2-tests.tgz test/ Source1: %{gem_name}-%{version}-tests.tgz +# Remove extended Tokens#filter for Ruby 2.6 compatibility. +# https://github.com/rubychan/coderay/pull/233 +Patch0: rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby >= 1.8.6 @@ -32,6 +35,8 @@ Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} +%patch0 -p1 + %build gem build ../%{gem_name}-%{version}.gemspec @@ -73,6 +78,9 @@ popd %doc %{gem_instdir}/README_INDEX.rdoc %changelog +* Thu Feb 14 2019 Jun Aruga - 1.1.2-5 +- Remove extended Tokens#filter for Ruby 2.6 compatibility. + * Sat Feb 02 2019 Fedora Release Engineering - 1.1.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild