pry-full 0.3 → 0.4
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.
- data/bin/demo-pry-exception_explorer +26 -0
- data/bin/demo-pry-rescue +29 -0
- metadata +58 -4
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'pry'
|
4
|
+
require 'pry-exception_explorer'
|
5
|
+
Pry.cli = true # for "enter-exception", currently needed unless run as "pry".
|
6
|
+
|
7
|
+
def faily_func
|
8
|
+
# You start at the location of the raise, but perhaps the trouble was
|
9
|
+
# earlier. Use pry-stack_explorer's "up" command to navigate.
|
10
|
+
raise 'Foo'
|
11
|
+
end
|
12
|
+
|
13
|
+
def outer_func
|
14
|
+
# Aha! You found me, the function at fault!
|
15
|
+
# Now, try "edit -c" to edit this file and make the "true" a "false"
|
16
|
+
should_never_happen = true
|
17
|
+
faily_func if should_never_happen
|
18
|
+
end
|
19
|
+
|
20
|
+
# You'll now see a demo of how to explore with pry-exception_explorer.
|
21
|
+
# Sometimes you end up with an exception in the REPL, and you didn't
|
22
|
+
# previously wrap it using the block form of the pry-exception_explorer trap.
|
23
|
+
# Go ahead and run "outer_func" (and notice how the exception is thrown, but
|
24
|
+
# you can subsequently run "wtf" to see the stack, and "enter-exception" to
|
25
|
+
# look around)
|
26
|
+
binding.pry
|
data/bin/demo-pry-rescue
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
def faily_func
|
3
|
+
fail
|
4
|
+
# Now that you're here, at the cause of the error, do:
|
5
|
+
# def faily_func; puts "Yay!" end
|
6
|
+
# Then do:
|
7
|
+
# try-again
|
8
|
+
end
|
9
|
+
|
10
|
+
def h8r_func
|
11
|
+
faily_func
|
12
|
+
rescue
|
13
|
+
# Now run cd-cause again.
|
14
|
+
# (Note: This type of rescue+raise handling is generally an anti-pattern.)
|
15
|
+
raise "Look at me, I found an exception!"
|
16
|
+
end
|
17
|
+
|
18
|
+
def h9r_func
|
19
|
+
h8r_func
|
20
|
+
rescue
|
21
|
+
# Now run: cd-cause
|
22
|
+
raise "Hey!! I found an exception!"
|
23
|
+
end
|
24
|
+
|
25
|
+
require 'pry-rescue'
|
26
|
+
Pry.rescue do
|
27
|
+
h9r_func
|
28
|
+
end
|
29
|
+
puts "Got to end of dem-pry-rescue. Wasn't that nice?"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-full
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.4'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-09-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry-debugger
|
@@ -61,7 +61,23 @@ dependencies:
|
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
|
-
name: pry-
|
64
|
+
name: pry-exception_explorer
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: pry-remote-em
|
65
81
|
requirement: !ruby/object:Gem::Requirement
|
66
82
|
none: false
|
67
83
|
requirements:
|
@@ -236,6 +252,22 @@ dependencies:
|
|
236
252
|
- - ! '>='
|
237
253
|
- !ruby/object:Gem::Version
|
238
254
|
version: '0'
|
255
|
+
- !ruby/object:Gem::Dependency
|
256
|
+
name: bond
|
257
|
+
requirement: !ruby/object:Gem::Requirement
|
258
|
+
none: false
|
259
|
+
requirements:
|
260
|
+
- - ! '>='
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: '0'
|
263
|
+
type: :runtime
|
264
|
+
prerelease: false
|
265
|
+
version_requirements: !ruby/object:Gem::Requirement
|
266
|
+
none: false
|
267
|
+
requirements:
|
268
|
+
- - ! '>='
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '0'
|
239
271
|
- !ruby/object:Gem::Dependency
|
240
272
|
name: jist
|
241
273
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,13 +284,35 @@ dependencies:
|
|
252
284
|
- - ! '>='
|
253
285
|
- !ruby/object:Gem::Version
|
254
286
|
version: '0'
|
287
|
+
- !ruby/object:Gem::Dependency
|
288
|
+
name: awesome_print
|
289
|
+
requirement: !ruby/object:Gem::Requirement
|
290
|
+
none: false
|
291
|
+
requirements:
|
292
|
+
- - ! '>='
|
293
|
+
- !ruby/object:Gem::Version
|
294
|
+
version: '0'
|
295
|
+
type: :runtime
|
296
|
+
prerelease: false
|
297
|
+
version_requirements: !ruby/object:Gem::Requirement
|
298
|
+
none: false
|
299
|
+
requirements:
|
300
|
+
- - ! '>='
|
301
|
+
- !ruby/object:Gem::Version
|
302
|
+
version: '0'
|
255
303
|
description: Pry is more of an ecosystem than a gem; this is a jumpstart.
|
256
304
|
email: rking-pry-full@sharpsaw.org
|
257
|
-
executables:
|
305
|
+
executables:
|
306
|
+
- demo-pry-rescue
|
307
|
+
- demo-pry-exception_explorer
|
258
308
|
extensions: []
|
259
309
|
extra_rdoc_files: []
|
260
310
|
files:
|
261
311
|
- lib/pry-full.rb
|
312
|
+
- !binary |-
|
313
|
+
YmluL2RlbW8tcHJ5LXJlc2N1ZQ==
|
314
|
+
- !binary |-
|
315
|
+
YmluL2RlbW8tcHJ5LWV4Y2VwdGlvbl9leHBsb3Jlcg==
|
262
316
|
homepage: https://github.com/rking/pry-full
|
263
317
|
licenses: []
|
264
318
|
post_install_message:
|