pry-rescue 0.10 → 0.11.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/sigsegv.rb +24 -0
- data/lib/pry-rescue/core_ext.rb +12 -0
- data/pry-rescue.gemspec +1 -1
- metadata +7 -6
data/examples/sigsegv.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# You'll need to 'apt-get install libsigsegv-dev' or 'brew install libsigsegv',
|
4
|
+
# then 'gem install neversaydie' (https://github.com/tenderlove/neversaydie)
|
5
|
+
#
|
6
|
+
# Then just run this program:
|
7
|
+
#
|
8
|
+
# ./examples/sigsegv.rb
|
9
|
+
#
|
10
|
+
# And watch as NeverSayDie tries to read a NULL pointer.
|
11
|
+
#
|
12
|
+
require 'neversaydie'
|
13
|
+
require 'pry-rescue'
|
14
|
+
|
15
|
+
class A #< BasicObject
|
16
|
+
def oops
|
17
|
+
foo = 1
|
18
|
+
NeverSayDie.segv
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
Pry::rescue do
|
23
|
+
A.new.oops
|
24
|
+
end
|
data/lib/pry-rescue/core_ext.rb
CHANGED
@@ -44,6 +44,18 @@ class << Pry
|
|
44
44
|
@raised = []
|
45
45
|
end
|
46
46
|
|
47
|
+
def rescue_everything!
|
48
|
+
@raised = []
|
49
|
+
@rescuing = true
|
50
|
+
Interception.listen do |exception, binding|
|
51
|
+
if defined?(PryStackExplorer)
|
52
|
+
@raised << [exception, binding.callers]
|
53
|
+
else
|
54
|
+
@raised << [exception, Array(binding)]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
47
59
|
private
|
48
60
|
|
49
61
|
# Ensure that Interception is active while running this block
|
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 = '0.
|
3
|
+
s.version = '0.11.pre.1'
|
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'
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-rescue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 0.11.pre.1
|
5
|
+
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Conrad Irwin
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-10-
|
14
|
+
date: 2012-10-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: pry
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- examples/loop.rb
|
116
116
|
- examples/random-exit.rb
|
117
117
|
- examples/rescue.rb
|
118
|
+
- examples/sigsegv.rb
|
118
119
|
- lib/pry-rescue.rb
|
119
120
|
- lib/pry-rescue/cli.rb
|
120
121
|
- lib/pry-rescue/commands.rb
|
@@ -154,12 +155,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
154
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
156
|
none: false
|
156
157
|
requirements:
|
157
|
-
- - ! '
|
158
|
+
- - ! '>'
|
158
159
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
160
|
+
version: 1.3.1
|
160
161
|
requirements: []
|
161
162
|
rubyforge_project:
|
162
|
-
rubygems_version: 1.8.
|
163
|
+
rubygems_version: 1.8.24
|
163
164
|
signing_key:
|
164
165
|
specification_version: 3
|
165
166
|
summary: Open a pry session on any unhandled exceptions
|