From e95244c02c4b664c94c79723c429ac73acfbdd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Wed, 3 Jan 2018 18:01:27 +0100 Subject: [PATCH] Fix Ruby 2.5 compatibility. --- ...place-deprecated-YAML-load_documents.patch | 30 +++++++++++++++++++ rubygem-RedCloth.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 rubygem-RedCloth-4.3.2-Replace-deprecated-YAML-load_documents.patch diff --git a/rubygem-RedCloth-4.3.2-Replace-deprecated-YAML-load_documents.patch b/rubygem-RedCloth-4.3.2-Replace-deprecated-YAML-load_documents.patch new file mode 100644 index 0000000..f390afd --- /dev/null +++ b/rubygem-RedCloth-4.3.2-Replace-deprecated-YAML-load_documents.patch @@ -0,0 +1,30 @@ +From 00b55ace17ed408b1b6129e1ba6c90fd4f0a6d2c Mon Sep 17 00:00:00 2001 +From: Matijs van Zuijlen +Date: Tue, 29 Aug 2017 08:08:36 +0200 +Subject: [PATCH] Replace deprecated YAML.load_documents + +The .load_documents method is deprecated and seems to have been removed +entirely in the upcoming Ruby 2.5. +--- + spec/spec_helper.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb +index af6279a..74a5cae 100644 +--- a/spec/spec_helper.rb ++++ b/spec/spec_helper.rb +@@ -26,11 +26,11 @@ def fixtures + Dir[File.join(File.dirname(__FILE__), *%w[fixtures *.yml])].each do |testfile| + testgroup = File.basename(testfile, '.yml') + num = 0 +- YAML::load_documents(File.open(testfile)) do |doc| ++ YAML::load_stream(File.open(testfile)) do |doc| + name = doc['name'] || num + @fixtures["#{testgroup} #{name}"] = doc + num += 1 + end + end + @fixtures +-end +\ No newline at end of file ++end diff --git a/rubygem-RedCloth.spec b/rubygem-RedCloth.spec index 3438121..e1792dc 100644 --- a/rubygem-RedCloth.spec +++ b/rubygem-RedCloth.spec @@ -11,7 +11,10 @@ URL: http://redcloth.org Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # Fixes failing tests on ARM which defaults to use unsigned char # http://jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/236-test-failure-on-armelpowerpc -Patch0: rubygem-redcloth-4.2.9-unsigned-char-fix.patch +Patch0: rubygem-redcloth-4.2.9-unsigned-char-fix.patch +# Fix Ruby 2.5 compatibility. +# https://github.com/jgarber/redcloth/pull/38/commits/00b55ace17ed408b1b6129e1ba6c90fd4f0a6d2c +Patch1: rubygem-RedCloth-4.3.2-Replace-deprecated-YAML-load_documents.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: rubygem(rspec) < 3 @@ -41,6 +44,7 @@ gem unpack %{SOURCE0} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %patch0 -p1 +%patch1 -p1 %build gem build %{gem_name}.gemspec