Fix FTBFS due to Ruby 3.0 incompatibility.

epel9
Vít Ondruch 4 years ago
parent e6c1e8d0d9
commit ecbc0053ab

@ -0,0 +1,26 @@
From 25f5022fcf3c43c43bfdb10ff2c1dc60588b9fa6 Mon Sep 17 00:00:00 2001
From: Barrett Ingram <bingram@eab.com>
Date: Sat, 2 Jan 2021 17:53:36 -0600
Subject: [PATCH] Add CI support for ruby 3 and fix broken spec
Spec started failing because a statement which we expected to be a
syntax error is now interpreted as a valid pattern-matching statement.
Swapping the hash-rockets for colons turns this back into a syntax
error.
---
spec/syntax_checking_spec.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletion(-)
diff --git a/spec/syntax_checking_spec.rb b/spec/syntax_checking_spec.rb
index ca75ba9f0..beba497f1 100644
--- a/spec/syntax_checking_spec.rb
+++ b/spec/syntax_checking_spec.rb
@@ -36,7 +36,7 @@
["o = Object.new.tap{ def o.render;", "'MEH'", "}"],
# multiple syntax errors reported in one SyntaxException
- ["puts {'key'=>'val'}.to_json"]
+ ["puts {key: 'val'}.to_json"]
].compact.each do |foo|
it "should raise an error on invalid syntax like #{foo.inspect}" do
redirect_pry_io(InputTester.new(*foo), @str_output) do

@ -2,7 +2,7 @@
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 0.13.1 Version: 0.13.1
Release: 2%{?dist} Release: 3%{?dist}
Summary: An IRB alternative and runtime developer console Summary: An IRB alternative and runtime developer console
License: MIT License: MIT
URL: http://pryrepl.org URL: http://pryrepl.org
@ -10,6 +10,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/pry/pry.git && cd pry # git clone https://github.com/pry/pry.git && cd pry
# git archive -v -o pry-0.13.1-spec.tar.gz v0.13.1 spec/ # git archive -v -o pry-0.13.1-spec.tar.gz v0.13.1 spec/
Source1: %{gem_name}-%{version}-spec.tar.gz Source1: %{gem_name}-%{version}-spec.tar.gz
# Fix spec which were testing invalid syntax which become valid in Ruby 3.0.
# https://github.com/pry/pry/pull/2170
Patch0: pry-0.13.1-Fix-broken-spec.patch
BuildRequires: ruby(release) BuildRequires: ruby(release)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
BuildRequires: ruby BuildRequires: ruby
@ -40,6 +43,10 @@ Documentation for %{name}.
%prep %prep
%setup -q -n %{gem_name}-%{version} -b 1 %setup -q -n %{gem_name}-%{version} -b 1
pushd %{_builddir}
%patch0 -p1
popd
# Relax method_source. It seems that the higher version is enforced just # Relax method_source. It seems that the higher version is enforced just
# due to JRuby. # due to JRuby.
%gemspec_remove_dep -g method_source "~> 1.0" %gemspec_remove_dep -g method_source "~> 1.0"
@ -96,6 +103,9 @@ popd
%doc %{gem_instdir}/README.md %doc %{gem_instdir}/README.md
%changelog %changelog
* Mon Jan 11 2021 Vít Ondruch <vondruch@redhat.com> - 0.13.1-3
- Fix FTBFS due to Ruby 3.0 incompatibility.
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-2 * Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

Loading…
Cancel
Save