pry-rescue 1.4.4 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/bin/rescue +9 -6
- data/pry-rescue.gemspec +20 -2
- data/spec/commands_spec.rb +28 -27
- data/spec/pry_rescue_spec.rb +10 -3
- data/spec/spec_helper.rb +0 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8498adfc62776fab874402fd91ff59f7a0b3811
|
4
|
+
data.tar.gz: 2efe1214b7acb9361f5c84754bad36aebfc769bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a60814bf969deba350559387f5a11c79fa6b03e86bb90656cee06f1ec26dd52e3db99ea815dbe033cb10fd65dcce59a932959c838a2b1b70a40d238057f2be54
|
7
|
+
data.tar.gz: 94c9e761195dcd0c7eb01c17af7670b0eea83fa9d59e36d4b24a1612f4b49807f6f12f0463072c4f5a7838d5ff256f54fb2d4629fb896d8edc9cfc37ea8e1121
|
data/.travis.yml
CHANGED
data/bin/rescue
CHANGED
@@ -34,12 +34,15 @@ when '-i'
|
|
34
34
|
when /\A-/
|
35
35
|
puts USAGE
|
36
36
|
exit
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
else
|
38
|
+
case File.basename(ARGV[0] || "")
|
39
|
+
when 'rails'
|
40
|
+
ENV['PRY_RESCUE_RAILS'] = 'true'
|
41
|
+
exec(*ARGV)
|
42
|
+
when /^re?spec|rake$/
|
43
|
+
ENV['SPEC_OPTS'] = "#{ENV['SPEC_OPTS']} -r pry-rescue/rspec"
|
44
|
+
exec(*ARGV)
|
45
|
+
end
|
43
46
|
end
|
44
47
|
|
45
48
|
if script = ARGV.shift
|
data/pry-rescue.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'pry-rescue'
|
3
|
-
s.version = '1.4.
|
3
|
+
s.version = '1.4.5'
|
4
4
|
s.summary = 'Open a pry session on any unhandled exceptions'
|
5
5
|
s.description = 'Allows you to wrap code in Pry::rescue{ } to open a pry session at any unhandled exceptions'
|
6
6
|
s.homepage = 'https://github.com/ConradIrwin/pry-rescue'
|
@@ -18,7 +18,25 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.add_development_dependency 'rake'
|
20
20
|
s.add_development_dependency 'rspec'
|
21
|
-
s.add_development_dependency 'yard'
|
22
21
|
s.add_development_dependency 'redcarpet'
|
23
22
|
s.add_development_dependency 'capybara'
|
23
|
+
|
24
|
+
# SPECIAL DEVELOPMENT GEM FOR OLD RUBY
|
25
|
+
# DONT USE THIS TRICK FOR RUNTIME GEM
|
26
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
|
27
|
+
s.add_development_dependency 'yard', '< 0.9.6'
|
28
|
+
s.add_development_dependency 'rack', ['~> 1.6', '< 1.7']
|
29
|
+
else
|
30
|
+
s.add_development_dependency 'yard'
|
31
|
+
end
|
32
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.1")
|
33
|
+
# capybara > nokogiri
|
34
|
+
s.add_development_dependency 'nokogiri', ['~> 1.6', '< 1.7.0']
|
35
|
+
end
|
36
|
+
if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.0")
|
37
|
+
# capybara > addressable > public_suffix
|
38
|
+
s.add_development_dependency 'public_suffix', ['~> 1.4', '< 1.5']
|
39
|
+
# capybara > mime-types
|
40
|
+
s.add_development_dependency 'mime-types', ['~> 2.6', '< 2.99']
|
41
|
+
end
|
24
42
|
end
|
data/spec/commands_spec.rb
CHANGED
@@ -3,19 +3,19 @@ require './spec/spec_helper'
|
|
3
3
|
describe "pry-rescue commands" do
|
4
4
|
describe "try-again" do
|
5
5
|
it "should throw try_again" do
|
6
|
-
PryRescue.
|
6
|
+
expect(PryRescue).to receive(:in_exception_context?).and_return(true)
|
7
7
|
|
8
|
-
|
9
|
-
Pry.new.process_command
|
10
|
-
}.
|
8
|
+
expect {
|
9
|
+
Pry.new.process_command("try-again")
|
10
|
+
}.to throw_symbol(:try_again)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should raise a CommandError if not in Pry::rescue" do
|
14
|
-
PryRescue.
|
14
|
+
expect(PryRescue).to receive(:in_exception_context?).and_return(false)
|
15
15
|
|
16
|
-
|
17
|
-
Pry.new.process_command "try-again"
|
18
|
-
}.
|
16
|
+
expect {
|
17
|
+
Pry.new.process_command "try-again"
|
18
|
+
}.to raise_error Pry::CommandError
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -28,11 +28,11 @@ describe "pry-rescue commands" do
|
|
28
28
|
b2 = binding
|
29
29
|
end
|
30
30
|
|
31
|
-
Pry.
|
32
|
-
raised.
|
33
|
-
|
31
|
+
allow(Pry).to receive(:rescued).once do |raised|
|
32
|
+
expect(raised).to eq e1
|
33
|
+
end
|
34
34
|
|
35
|
-
Pry.new.process_command 'cd-cause e1'
|
35
|
+
Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause e1'
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should enter the context of _ex_ if no exception is given" do
|
@@ -47,11 +47,11 @@ describe "pry-rescue commands" do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
Pry.
|
51
|
-
raised.
|
52
|
-
|
50
|
+
allow(Pry).to receive(:rescued).once do |raised|
|
51
|
+
expect(raised).to eq _ex_
|
52
|
+
end
|
53
53
|
|
54
|
-
Pry.new.process_command 'cd-cause'
|
54
|
+
Pry.new.tap{ |p| p.push_binding(b2) }.process_command 'cd-cause'
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -73,9 +73,10 @@ describe "pry-rescue commands" do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
PryRescue.
|
76
|
+
expect(PryRescue).to receive(:enter_exception_context).once.with(e1)
|
77
77
|
|
78
|
-
Pry.new.process_command 'cd-cause'
|
78
|
+
Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
|
79
|
+
# PryTester.new(binding).process_command 'cd-cause'
|
79
80
|
end
|
80
81
|
|
81
82
|
it "should raise a CommandError if no previous commands" do
|
@@ -88,9 +89,9 @@ describe "pry-rescue commands" do
|
|
88
89
|
_ex_ = e1
|
89
90
|
end
|
90
91
|
|
91
|
-
|
92
|
-
Pry.new.process_command 'cd-cause'
|
93
|
-
}.
|
92
|
+
expect {
|
93
|
+
Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
|
94
|
+
}.to raise_error Pry::CommandError, /No previous exception/
|
94
95
|
end
|
95
96
|
|
96
97
|
it "should raise a CommandError on a re-raise" do
|
@@ -107,15 +108,15 @@ describe "pry-rescue commands" do
|
|
107
108
|
end
|
108
109
|
_rescued_ = _ex_
|
109
110
|
|
110
|
-
|
111
|
-
Pry.new.process_command 'cd-cause'
|
112
|
-
}.
|
111
|
+
expect {
|
112
|
+
Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
|
113
|
+
}.to raise_error Pry::CommandError, /No previous exception/
|
113
114
|
end
|
114
115
|
|
115
116
|
it "should raise a CommandError if not in Pry::rescue" do
|
116
|
-
|
117
|
-
Pry.new.process_command 'cd-cause'
|
118
|
-
}.
|
117
|
+
expect {
|
118
|
+
Pry.new.tap{ |p| p.push_binding(binding) }.process_command 'cd-cause'
|
119
|
+
}.to raise_error Pry::CommandError, /No previous exception/
|
119
120
|
end
|
120
121
|
end
|
121
122
|
end
|
data/spec/pry_rescue_spec.rb
CHANGED
@@ -53,9 +53,16 @@ describe "PryRescue.load" do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it "should skip pwd, even if it is a gem (but not vendor stuff)" do
|
56
|
-
Gem::Specification.stub :any? do true end
|
57
|
-
|
58
|
-
|
56
|
+
# Gem::Specification.stub :any? do true end
|
57
|
+
allow(Gem::Specification).to receive(:any?).and_return(true)
|
58
|
+
|
59
|
+
expect(
|
60
|
+
PryRescue.send(:user_path?, Dir.pwd + '/asdf.rb')
|
61
|
+
).to be true
|
62
|
+
|
63
|
+
expect(
|
64
|
+
PryRescue.send(:user_path?, Dir.pwd + '/vendor/asdf.rb')
|
65
|
+
).to be false
|
59
66
|
end
|
60
67
|
|
61
68
|
it "should filter out duplicate stack frames" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-rescue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conrad Irwin
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry
|
@@ -83,7 +83,7 @@ dependencies:
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
86
|
+
name: redcarpet
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - ">="
|
@@ -97,7 +97,7 @@ dependencies:
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
100
|
+
name: capybara
|
101
101
|
requirement: !ruby/object:Gem::Requirement
|
102
102
|
requirements:
|
103
103
|
- - ">="
|
@@ -111,7 +111,7 @@ dependencies:
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
114
|
+
name: yard
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
@@ -202,9 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: '0'
|
203
203
|
requirements: []
|
204
204
|
rubyforge_project:
|
205
|
-
rubygems_version: 2.
|
205
|
+
rubygems_version: 2.6.8
|
206
206
|
signing_key:
|
207
207
|
specification_version: 4
|
208
208
|
summary: Open a pry session on any unhandled exceptions
|
209
209
|
test_files: []
|
210
|
-
has_rdoc:
|