diff --git a/pry-0.13.1-Fix-broken-spec.patch b/pry-0.13.1-Fix-broken-spec.patch new file mode 100644 index 0000000..100c9ff --- /dev/null +++ b/pry-0.13.1-Fix-broken-spec.patch @@ -0,0 +1,26 @@ +From 25f5022fcf3c43c43bfdb10ff2c1dc60588b9fa6 Mon Sep 17 00:00:00 2001 +From: Barrett Ingram +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 diff --git a/rubygem-pry.spec b/rubygem-pry.spec index e67ee15..1bae8fe 100644 --- a/rubygem-pry.spec +++ b/rubygem-pry.spec @@ -2,7 +2,7 @@ Name: rubygem-%{gem_name} Version: 0.13.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: An IRB alternative and runtime developer console License: MIT 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 archive -v -o pry-0.13.1-spec.tar.gz v0.13.1 spec/ 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: rubygems-devel BuildRequires: ruby @@ -40,6 +43,10 @@ Documentation for %{name}. %prep %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 # due to JRuby. %gemspec_remove_dep -g method_source "~> 1.0" @@ -96,6 +103,9 @@ popd %doc %{gem_instdir}/README.md %changelog +* Mon Jan 11 2021 Vít Ondruch - 0.13.1-3 +- Fix FTBFS due to Ruby 3.0 incompatibility. + * Wed Jul 29 2020 Fedora Release Engineering - 0.13.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild