Update to Pry 0.10.4.

epel9
Vít Ondruch 8 years ago
parent 1bf48ce1dc
commit 4b675c30cb

2
.gitignore vendored

@ -3,3 +3,5 @@
/pry-0.9.12.6.gem
/pry-0.10.1.gem
/pry-0.10.1-tests.tar.xz
/pry-0.10.4-tests.tar.xz
/pry-0.10.4.gem

@ -1,37 +0,0 @@
From 74784e8f7889c3b8f0bb337f04b050e79a3df34a Mon Sep 17 00:00:00 2001
From: Ryunosuke SATO <tricknotes.rs@gmail.com>
Date: Tue, 14 Oct 2014 23:02:28 +0900
Subject: [PATCH] Handle error about frozen object in Ruby 2.2
This kind of error message seems to be updated in Ruby 2.2.
For example, the following code throws an error that has different
error message with Ruby version:
```
"".freeze.instance_eval do
def hi
end
end
```
In Ruby 2.1.3:
> RuntimeError: can't modify frozen Class
In Ruby 2.2.0-preview1:
> RuntimeError: can't modify frozen object
---
lib/pry/exceptions.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/pry/exceptions.rb b/lib/pry/exceptions.rb
index 0204d84..080b72e 100644
--- a/lib/pry/exceptions.rb
+++ b/lib/pry/exceptions.rb
@@ -52,6 +52,7 @@ module FrozenObjectException
def self.===(exception)
["can't modify frozen class/module",
"can't modify frozen Class",
+ "can't modify frozen object",
].include?(exception.message)
end
end

@ -1,61 +0,0 @@
From 0807328bcfd1585b0f668c269dd232505fab8a2c Mon Sep 17 00:00:00 2001
From: John Mair <jrmair@gmail.com>
Date: Mon, 16 Feb 2015 21:10:00 +0100
Subject: [PATCH] Rename helper spec: singleton_class(arg) -> eigenclass(arg)
It was causing the most ridiculous non-sensical test failures, possibly a bug in Ruby itself, but this patch fixes it
---
spec/method_spec.rb | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/spec/method_spec.rb b/spec/method_spec.rb
index 980c555..8e38b6d 100644
--- a/spec/method_spec.rb
+++ b/spec/method_spec.rb
@@ -389,7 +389,7 @@ class Lower < Low; extend N; end
class Bottom < Lower; extend O; end
end
- def singleton_class(obj); class << obj; self; end; end
+ def eigen_class(obj); class << obj; self; end; end
it "should look at a class and then its superclass" do
Pry::Method.instance_resolution_order(LS::Next).should == [LS::Next] + Pry::Method.instance_resolution_order(LS::Top)
@@ -409,7 +409,7 @@ def singleton_class(obj); class << obj; self; end; end
it "should include the singleton class of objects" do
obj = LS::Low.new
- Pry::Method.resolution_order(obj).should == [singleton_class(obj)] + Pry::Method.instance_resolution_order(LS::Low)
+ Pry::Method.resolution_order(obj).should == [eigen_class(obj)] + Pry::Method.instance_resolution_order(LS::Low)
end
it "should not include singleton classes of numbers" do
@@ -417,11 +417,11 @@ def singleton_class(obj); class << obj; self; end; end
end
it "should include singleton classes for classes" do
- Pry::Method.resolution_order(LS::Low).should == [singleton_class(LS::Low)] + Pry::Method.resolution_order(LS::Next)
+ Pry::Method.resolution_order(LS::Low).should == [eigen_class(LS::Low)] + Pry::Method.resolution_order(LS::Next)
end
it "should include modules included into singleton classes" do
- Pry::Method.resolution_order(LS::Lower).should == [singleton_class(LS::Lower), LS::N, LS::M] + Pry::Method.resolution_order(LS::Low)
+ Pry::Method.resolution_order(LS::Lower).should == [eigen_class(LS::Lower), LS::N, LS::M] + Pry::Method.resolution_order(LS::Low)
end
it "should include modules at most once" do
@@ -429,12 +429,12 @@ def singleton_class(obj); class << obj; self; end; end
end
it "should include modules at the point which they would be reached" do
- Pry::Method.resolution_order(LS::Bottom).should == [singleton_class(LS::Bottom), LS::O] + (Pry::Method.resolution_order(LS::Lower))
+ Pry::Method.resolution_order(LS::Bottom).should == [eigen_class(LS::Bottom), LS::O] + (Pry::Method.resolution_order(LS::Lower))
end
it "should include the Pry::Method.instance_resolution_order of Class after the singleton classes" do
Pry::Method.resolution_order(LS::Top).should ==
- [singleton_class(LS::Top), singleton_class(Object), singleton_class(BasicObject),
+ [eigen_class(LS::Top), eigen_class(Object), eigen_class(BasicObject),
*Pry::Method.instance_resolution_order(Class)]
end
end

@ -2,7 +2,7 @@
set -e
VERSION=0.10.1
VERSION=0.10.4
GITHUBURL=https://github.com/pry/pry/archive/v${VERSION}.zip

@ -1,12 +1,12 @@
%global gem_name pry
Summary: An IRB alternative and runtime developer console
Name: rubygem-%{gem_name}
Version: 0.10.1
Release: 3%{?dist}
Version: 0.10.4
Release: 1%{?dist}
Summary: An IRB alternative and runtime developer console
Group: Development/Languages
License: MIT
URL: http://pryrepl.org/
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
@ -14,12 +14,6 @@ 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 "wrong number of arguments (0 for 1)" test suite error.
# https://github.com/pry/pry/commit/0807328bcfd1585b0f668c269dd232505fab8a2c
Patch1: rubygem-pry-0.10.1-Rename-helper-singleton_class-to-eigenclass.patch
# Fix "can't modify frozen object" error.
# https://github.com/pry/pry/commit/74784e8f7889c3b8f0bb337f04b050e79a3df34a
Patch2: rubygem-pry-0.10.1-Handle-error-about-frozen-object-in-Ruby-2.2.patch
%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Requires: ruby(release)
Requires: ruby(rubygems)
@ -35,11 +29,8 @@ BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(coderay) => 1.1.0
BuildRequires: rubygem(coderay) < 1.2
BuildRequires: rubygem(slop) => 3.4
BuildRequires: rubygem(slop) < 4
BuildRequires: rubygem(method_source) => 0.8.1
BuildRequires: rubygem(method_source) < 0.9
# editor specs fail if no editor is available (soft requirement)
BuildRequires: vi
BuildArch: noarch
@ -63,20 +54,10 @@ Documentation for %{name}.
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version} -a 2
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
# Remove dependency on bundler
sed -e "/require 'bundler\/setup'/d" -i spec/helper.rb
sed -e "/Bundler.require/d" -i spec/helper.rb
# rm stray openstruct reference
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
gem build %{gem_name}.gemspec
@ -95,17 +76,31 @@ cp -a .%{_bindir}/* \
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
%check
cp -pr spec .%{gem_instdir}
pushd .%{gem_instdir}
rspec -I"lib:spec" spec/*_spec.rb
rm -rf spec/
tar xvf %{SOURCE2}
# rm stray openstruct reference
patch -p1 < %{PATCH0}
# 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
rspec spec
popd
%files
%{!?_licensedir:%global license %%doc}
%dir %{gem_instdir}
%license %{gem_instdir}/LICENSE
%{_bindir}/pry
%license %{gem_instdir}/LICENSE
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
@ -117,6 +112,9 @@ popd
%doc %{gem_instdir}/README.md
%changelog
* Fri Oct 14 2016 Vít Ondruch <vondruch@redhat.com> - 0.10.4-1
- Update to Pry 0.10.4.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

@ -1,2 +1,2 @@
81b69c5d073e089d73e7c6bfc09efe56 pry-0.10.1.gem
f7960293f4ee96756752cca7a1b4fb26 pry-0.10.1-tests.tar.xz
8f7d278547ac8fdf75ef616ed260400f pry-0.10.4-tests.tar.xz
38e6e93cfb9f940f558fa3e36274b68b pry-0.10.4.gem
Loading…
Cancel
Save