pry-exception_explorer 0.1.0pre2 → 0.1.0pre3
Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile
CHANGED
@@ -34,9 +34,9 @@ end
|
|
34
34
|
|
35
35
|
desc "reinstall gem"
|
36
36
|
task :reinstall => :gems do
|
37
|
-
sh "gem uninstall pry-exception_explorer"
|
37
|
+
sh "gem uninstall pry-exception_explorer" rescue nil
|
38
38
|
sh "gem install #{direc}/pkg/pry-exception_explorer-#{PryExceptionExplorer::VERSION}.gem"
|
39
|
-
end
|
39
|
+
end
|
40
40
|
|
41
41
|
desc "run tests"
|
42
42
|
task :test do
|
@@ -42,22 +42,34 @@ end
|
|
42
42
|
PryExceptionExplorer::Commands = Pry::CommandSet.new do
|
43
43
|
|
44
44
|
command "enter-exception", "Enter the context of the last exception" do
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
ex = _pry_.last_exception
|
46
|
+
if ex && ex.exception_call_stack
|
47
|
+
PryStackExplorer.create_and_push_frame_manager(_pry_.last_exception.exception_call_stack, _pry_)
|
48
|
+
PryStackExplorer.frame_manager(_pry_).user[:exception] = _pry_.last_exception
|
49
|
+
PryStackExplorer.frame_manager(_pry_).refresh_frame
|
50
|
+
elsif ex
|
51
|
+
output.puts "Current exception can't be entered! (perhaps a C exception)"
|
52
|
+
else
|
53
|
+
output.puts "No exception to enter!"
|
54
|
+
end
|
48
55
|
end
|
49
56
|
|
50
57
|
command "exit-exception", "Leave the context of the current exception." do
|
51
|
-
PryStackExplorer.
|
52
|
-
|
58
|
+
fm = PryStackExplorer.frame_manager(_pry_)
|
59
|
+
if fm && fm.user[:exception]
|
60
|
+
PryStackExplorer.pop_frame_manager(_pry_)
|
61
|
+
PryStackExplorer.frame_manager(_pry_).refresh_frame
|
62
|
+
else
|
63
|
+
output.puts "You are not in an exception!"
|
64
|
+
end
|
53
65
|
end
|
54
66
|
|
55
67
|
command "continue-exception", "Attempt to continue the current exception." do
|
56
|
-
|
68
|
+
fm = PryStackExplorer.frame_manager(_pry_)
|
57
69
|
|
58
|
-
if
|
70
|
+
if fm && fm.user[:exception] && fm.user[:exception].continuation
|
59
71
|
PryStackExplorer.pop_frame_manager(_pry_)
|
60
|
-
|
72
|
+
fm.user[:exception].continue
|
61
73
|
else
|
62
74
|
output.puts "No exception to continue!"
|
63
75
|
end
|
@@ -8,7 +8,7 @@ module PryExceptionExplorer
|
|
8
8
|
rescue Exception => ex
|
9
9
|
Pry.config.hooks.add_hook(:when_started, :setup_exception_context) do |binding_stack, _pry_|
|
10
10
|
binding_stack.replace([ex.exception_call_stack.first])
|
11
|
-
PryStackExplorer.
|
11
|
+
PryStackExplorer.create_and_push_frame_manager(ex.exception_call_stack, _pry_)
|
12
12
|
PryStackExplorer.frame_manager(_pry_).user[:exception] = ex
|
13
13
|
end
|
14
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-exception_explorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.0pre3
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry-stack_explorer
|
16
|
-
requirement: &
|
16
|
+
requirement: &70174405621960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70174405621960
|
25
25
|
description: FIX ME
|
26
26
|
email: jrmair@gmail.com
|
27
27
|
executables: []
|