pry-plus 0.1

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-bond ADDED
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pry'
4
+ begin
5
+ require 'bond'
6
+ rescue LoadError
7
+ warn "You have to have the bond gem and a pry >0.9.10 for this demo to work."
8
+ exit 1
9
+ end
10
+
11
+ DEMO_METHODS = %w(tab_hash tab_pry_commands tab_chain tab_require)
12
+ NOTABLE_LINE_OFFSET_BY_CONVENTION = 2
13
+ def go
14
+ DEMO_METHODS.each do |name| method(name).call end
15
+ "That's all, for now!"
16
+ end
17
+
18
+ def tab_hash
19
+ data = {asdf: 1, bsdf: 2, csdf: 3}
20
+ 1 # ← (Sorry about this noise. It's to give the debugger a breakpoint.)
21
+ # To see hash-key completion, type: data[:<Tab><Tab>
22
+ # (then hit ^D to keep going)
23
+ end
24
+
25
+
26
+
27
+
28
+
29
+
30
+ def tab_pry_commands
31
+ # Without bond, pry tries to complete symbols for every command context.
32
+ 1
33
+ # Try it out:
34
+ # edit ./<Tab>
35
+ # (Note that not all commands have perfect completion lists. Github Issues
36
+ # are welcomed if you want to point out the ones that still need work!)
37
+ end
38
+
39
+
40
+
41
+
42
+ class Donkey; def eeyaww; 'EEYAWW!' end end
43
+ class Monkey; def donkey; Donkey.new end end
44
+ def tab_chain
45
+ # Try Monkey.new.donkey.<Tab><Tab>
46
+ 1
47
+ # Bond actually evaluates the method chain, completing only Donkey methods.
48
+ # (If you try this in the builtin completer, it will complete *all* methods)
49
+ end
50
+
51
+
52
+
53
+
54
+
55
+ def tab_require
56
+ # Oh, so you'd like to `require` with tabcompletion?
57
+ 1
58
+ # Try:
59
+ # require 'u<Tab><Tab>
60
+ # (Don't worry about the .rb at the end, require works fine with it.)
61
+ end
62
+
63
+
64
+ Pry.config.hooks.add_hook :when_started, :test_hook do |target, opt, _pry_|
65
+ DEMO_METHODS.each do |name|
66
+ meth = method name
67
+ file, line = meth.source_location
68
+ line += NOTABLE_LINE_OFFSET_BY_CONVENTION
69
+ PryDebugger::Breakpoints.add file, line
70
+ end
71
+ # This is kinda junky, but required to satisfy the breakpoint:
72
+ Pry.instance_variable_get(:@processor).instance_variable_set :@pry, _pry_
73
+ end
74
+
75
+
76
+
77
+
78
+
79
+ binding.pry
80
+ # Let's check out few new features from the new completion backed by the `bond`
81
+ # gem.
82
+ # To get started, hit ^D.
83
+
84
+
85
+
86
+ go
@@ -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
@@ -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?"
data/bin/pryq ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ loader = 'Thread.new { Pry.load_plugins; puts "Done." if ENV["PRYQ_VERBOSE"] };'
3
+ warn 'Note: pry-doc does not work under pryq'
4
+ system *(%W(pry --no-plugins -e #{loader}) + ARGV)
data/lib/pry-plus.rb ADDED
@@ -0,0 +1,3 @@
1
+ # Total virtual lib right now.
2
+ # (This is necessary to keep pry from emitting a warning on startup, since it
3
+ # loops over all gems starting with "pry")
metadata ADDED
@@ -0,0 +1,172 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pry-plus
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - ☈king
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-10-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry-doc
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: pry-debugger
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: pry-stack_explorer
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: pry-exception_explorer
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: plymouth
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: pry-rescue
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: jist
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: pry-doc + pry-debugger + pry-stack_explorer + pry-exception_explorer
127
+ + plymouth + pry-rescue + jist
128
+ email: rking-pry-plus@sharpsaw.org
129
+ executables:
130
+ - demo-pry-rescue
131
+ - demo-pry-bond
132
+ - pryq
133
+ - demo-pry-exception_explorer
134
+ extensions: []
135
+ extra_rdoc_files: []
136
+ files:
137
+ - lib/pry-plus.rb
138
+ - !binary |-
139
+ YmluL2RlbW8tcHJ5LXJlc2N1ZQ==
140
+ - !binary |-
141
+ YmluL2RlbW8tcHJ5LWJvbmQ=
142
+ - !binary |-
143
+ YmluL3ByeXE=
144
+ - !binary |-
145
+ YmluL2RlbW8tcHJ5LWV4Y2VwdGlvbl9leHBsb3Jlcg==
146
+ homepage: https://github.com/rking/pry-plus
147
+ licenses:
148
+ - CC0
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ required_rubygems_version: !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 1.8.24
168
+ signing_key:
169
+ specification_version: 3
170
+ summary: Pry + Essential Plugins
171
+ test_files: []
172
+ has_rdoc: