Fix Ruby 2.5 compatibility.

f38
Vít Ondruch 7 years ago
parent 261f50935a
commit e95244c02c

@ -0,0 +1,30 @@
From 00b55ace17ed408b1b6129e1ba6c90fd4f0a6d2c Mon Sep 17 00:00:00 2001
From: Matijs van Zuijlen <matijs@matijs.net>
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

@ -12,6 +12,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Fixes failing tests on ARM which defaults to use unsigned char # Fixes failing tests on ARM which defaults to use unsigned char
# http://jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/236-test-failure-on-armelpowerpc # 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: ruby(release)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
BuildRequires: rubygem(rspec) < 3 BuildRequires: rubygem(rspec) < 3
@ -41,6 +44,7 @@ gem unpack %{SOURCE0}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%patch0 -p1 %patch0 -p1
%patch1 -p1
%build %build
gem build %{gem_name}.gemspec gem build %{gem_name}.gemspec

Loading…
Cancel
Save