Update to Pry 0.13.1.

Resolves: rhbz#1493806
Resovles: rhbz#1800023
epel9
Vít Ondruch 5 years ago
parent 25ff4645b5
commit 11a4b0b19d

2
.gitignore vendored

@ -5,3 +5,5 @@
/pry-0.10.1-tests.tar.xz
/pry-0.10.4-tests.tar.xz
/pry-0.10.4.gem
/pry-0.13.1-spec.tar.gz
/pry-0.13.1.gem

@ -1,32 +0,0 @@
From ff6263fd9ddf2d689ecfa8fa7eb1216bfad441a8 Mon Sep 17 00:00:00 2001
From: Akira Matsuda <ronnie@dio.jp>
Date: Thu, 8 Dec 2016 03:51:38 +0900
Subject: [PATCH] Avoid calling Ruby 2.4+ String#pretty_print in ColorPrinter
Ruby 2.4+ defines String's own pretty_print that prints multiline Strings prettier
see: https://bugs.ruby-lang.org/issues/12664
fixes #1585
---
lib/pry/color_printer.rb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/pry/color_printer.rb b/lib/pry/color_printer.rb
index 48bcc1a..ce52b8d 100644
--- a/lib/pry/color_printer.rb
+++ b/lib/pry/color_printer.rb
@@ -31,7 +31,13 @@ def text(str, width = str.length)
end
def pp(obj)
- super
+ if String === obj
+ # Avoid calling Ruby 2.4+ String#pretty_print that prints multiline
+ # Strings prettier
+ Object.instance_method(:pretty_print).bind(obj).call
+ else
+ super
+ end
rescue => e
raise if e.is_a? Pry::Pager::StopPaging
begin

@ -1,32 +0,0 @@
From 866ea0b9f983229f53997dd9c87212281683f3df Mon Sep 17 00:00:00 2001
From: Akira Matsuda <ronnie@dio.jp>
Date: Thu, 8 Dec 2016 03:54:12 +0900
Subject: [PATCH] Fixnum and Bignum are unified into Integer since Ruby 2.4
see: https://bugs.ruby-lang.org/issues/12005
---
spec/commands/ls_spec.rb | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/spec/commands/ls_spec.rb b/spec/commands/ls_spec.rb
index 0fc489b..d89fcc2 100644
--- a/spec/commands/ls_spec.rb
+++ b/spec/commands/ls_spec.rb
@@ -48,8 +48,15 @@
end
describe "immediates" do
- it "should work on Fixnum" do
- pry_eval("ls 5").should =~ /Fixnum#methods:.*modulo/m
+ # Ruby 2.4+
+ if 5.class.name == 'Integer'
+ it "should work on Integer" do
+ expect(pry_eval("ls 5")).to match(/Integer#methods:.*modulo/m)
+ end
+ else
+ it "should work on Fixnum" do
+ expect(pry_eval("ls 5")).to match(/Fixnum#methods:.*modulo/m)
+ end
end
end

@ -1,44 +0,0 @@
From 81fc96f73bdb26901c75838262779002bf6e14c5 Mon Sep 17 00:00:00 2001
From: rpag <rpag@singletonclass.com>
Date: Mon, 12 Jan 2015 20:18:59 +0000
Subject: [PATCH] support custom implementation of BasicObject#inspect.
If BasicObject or a subclass of BasicObject implements #inspect,
we will try to use its return value as output but if that fails,
we'll fallback on __id__.
fixes #1341
---
lib/pry/color_printer.rb | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/lib/pry/color_printer.rb b/lib/pry/color_printer.rb
index 218a821..48bcc1a 100644
--- a/lib/pry/color_printer.rb
+++ b/lib/pry/color_printer.rb
@@ -34,14 +34,17 @@ def pp(obj)
super
rescue => e
raise if e.is_a? Pry::Pager::StopPaging
-
- # Read the class name off of the singleton class to provide a default
- # inspect.
- singleton = class << obj; self; end
- ancestors = Pry::Method.safe_send(singleton, :ancestors)
- klass = ancestors.reject { |k| k == singleton }.first
- obj_id = obj.__id__.to_s(16) rescue 0
- str = "#<#{klass}:0x#{obj_id}>"
+ begin
+ str = obj.inspect
+ rescue Exception
+ # Read the class name off of the singleton class to provide a default
+ # inspect.
+ singleton = class << obj; self; end
+ ancestors = Pry::Method.safe_send(singleton, :ancestors)
+ klass = ancestors.reject { |k| k == singleton }.first
+ obj_id = obj.__id__.to_s(16) rescue 0
+ str = "#<#{klass}:0x#{obj_id}>"
+ end
text highlight_object_literal(str)
end

@ -1,27 +0,0 @@
From 683b1abff5785a7fe2140ddf502ab82dbb968656 Mon Sep 17 00:00:00 2001
From: Ken Dreyer <ktdreyer@ktdreyer.com>
Date: Tue, 9 Dec 2014 20:44:02 -0700
Subject: [PATCH] spec: rm stray reference to OpenStruct
OpenStruct was removed in 91d412c044f174a2c50d1583a3f34c1f0f795e7d, but
a stray reference remained in the test suite. Remove it here.
---
spec/hooks_spec.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/hooks_spec.rb b/spec/hooks_spec.rb
index 8248f03..fa5bf05 100644
--- a/spec/hooks_spec.rb
+++ b/spec/hooks_spec.rb
@@ -368,7 +368,7 @@ describe Pry::Hooks do
describe "after_session hook" do
it 'should always run, even if uncaught exception bubbles out of repl' do
- o = OpenStruct.new
+ o = Pry::Config.new
o.great_escape = Class.new(StandardError)
old_ew = Pry.config.exception_whitelist
--
1.9.3

@ -1,26 +0,0 @@
#!/bin/bash
set -e
VERSION=0.10.4
GITHUBURL=https://github.com/pry/pry/archive/v${VERSION}.zip
# download zipball
if [[ ! -f pry-$VERSION.zip ]]; then
curl -o pry-$VERSION.zip -L $GITHUBURL
fi
# extract zipball
[[ -d pry-$VERSION ]] && rm -r pry-$VERSION
unzip pry-$VERSION.zip
pushd pry-$VERSION
# repack
tar -cJvf pry-$VERSION-tests.tar.xz spec
mv pry-$VERSION-tests.tar.xz ..
popd
# Clean up
rm pry-$VERSION.zip
rm -r pry-$VERSION

@ -1,49 +1,32 @@
%global gem_name pry
Name: rubygem-%{gem_name}
Version: 0.10.4
Release: 9%{?dist}
Version: 0.13.1
Release: 1%{?dist}
Summary: An IRB alternative and runtime developer console
License: MIT
URL: http://pryrepl.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Upstream does not ship the test suite in the gem.
Source1: %{name}-generate-test-tarball.sh
Source2: %{gem_name}-%{version}-tests.tar.xz
# rm stray openstruct reference. Upstream at
# https://github.com/pry/pry/commit/70942ad3b2d93e028fc3e8bfe1c6bd11ec79ffad
Patch0: rubygem-pry-0.10.1-rm-openstruct.patch
# Fix Ruby 2.4 compatibility.
# https://github.com/pry/pry/pull/1586
Patch1: pry-0.10.4-support-custom-implementation-of-BasicObject-inspect.patch
Patch2: pry-0.10.4-Avoid-calling-Ruby-2.4-String-pretty_print-in-ColorPrinter.patch
Patch3: pry-0.10.4-Fixnum-and-Bignum-are-unified-into-Integer-since-Ruby-2.4.patch
%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Requires: ruby(release)
Requires: ruby(rubygems)
Requires: rubygem(coderay) => 1.1.0
Requires: rubygem(coderay) < 1.2
Requires: rubygem(slop) => 3.4
Requires: rubygem(slop) < 4
Requires: rubygem(method_source) => 0.8.1
Requires: rubygem(method_source) < 0.9
%endif
# 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
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(bundler)
BuildRequires: rubygem(coderay) => 1.1.0
BuildRequires: rubygem(slop) => 3.4
BuildRequires: rubygem(method_source) => 0.8.1
BuildRequires: rubygem(rspec)
# editor specs fail if no editor is available (soft requirement)
BuildRequires: vi
# https://github.com/pry/pry/pull/1498
Provides: bundled(rubygem-slop) = 3.4.0
BuildArch: noarch
%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version}
%endif
%description
An IRB alternative and runtime developer console.
Pry is a runtime developer console and IRB alternative with powerful
introspection capabilities. Pry aims to be more than an IRB replacement. It is
an attempt to bring REPL driven programming to the Ruby language.
%package doc
@ -55,18 +38,20 @@ BuildArch: noarch
Documentation for %{name}.
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
%setup -q -n %{gem_name}-%{version} -b 1
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
# Relax method_source. It seems that the higher version is enforced just
# due to JRuby.
%gemspec_remove_dep -g method_source "~> 1.0"
%gemspec_add_dep -g method_source "< 2"
%patch1 -p1
%patch2 -p1
%build
gem build %{gem_name}.gemspec
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install
%install
@ -83,28 +68,20 @@ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
%check
pushd .%{gem_instdir}
tar xvf %{SOURCE2}
# rm stray openstruct reference
cat %{PATCH0} | patch -p1
cat %{PATCH3} | patch -p1
ln -s %{_builddir}/spec spec
# Rakefile is used by editor test.
touch Rakefile
# rubygem-gist is not available in Fedora yet.
sed -i '/gist --login/i pending "rubygem-gist is not in Fedora yet."' \
spec/commands/gist_spec.rb
# Remove dependency on bundler
sed -e "/require 'bundler\/setup'/ s/^/#/" -i spec/helper.rb
sed -e "/Bundler.require/ s/^/#/" -i spec/helper.rb
# Original test suite is run from non-versioned directory:
# https://github.com/pry/pry/blob/9d9ae4a0b0bd487bb41170c834b3fa417e161f23/spec/cli_spec.rb#L219
sed -i '/pry\/foo/ s/pry/pry-%{version}/' spec/cli_spec.rb
rspec spec
# The bundler is required just to make /spec/integration/bundler_spec.rb pass.
RUBYOPT=-rbundler rspec -rspec_helper spec
popd
%files
%{!?_licensedir:%global license %%doc}
%dir %{gem_instdir}
%{_bindir}/pry
%license %{gem_instdir}/LICENSE
@ -119,6 +96,11 @@ popd
%doc %{gem_instdir}/README.md
%changelog
* Mon Apr 20 2020 Vít Ondruch <vondruch@redhat.com> - 0.13.1-1
- Update to Pry 0.13.1.
Resolves: rhbz#1493806
Resovles: rhbz#1800023
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

@ -1,2 +1,2 @@
8f7d278547ac8fdf75ef616ed260400f pry-0.10.4-tests.tar.xz
38e6e93cfb9f940f558fa3e36274b68b pry-0.10.4.gem
SHA512 (pry-0.13.1-spec.tar.gz) = f2377133d766ac0a8c3a09fd17ee0e45ebde33a160706b17b13f8b511c279538f0eb50262796d96b2237940fa1af6087e0ae6541c81bd42afb935c9f762d978f
SHA512 (pry-0.13.1.gem) = cc7aaf88126fbb514df1cef796c9b5b1d3b8d4f965d64348780aaa20de4670fb254238c2ee191063256e5d5922523b8b366e7b67152c296fba107f1bf91ee221

Loading…
Cancel
Save