pry-full 0.4 → 0.6
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 +86 -0
- data/bin/pryq +3 -0
- metadata +14 -21
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
|
data/bin/pryq
ADDED
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.6'
|
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-09-
|
13
|
+
date: 2012-09-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry-debugger
|
@@ -172,22 +172,6 @@ dependencies:
|
|
172
172
|
- - ! '>='
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
|
-
- !ruby/object:Gem::Dependency
|
176
|
-
name: pry-buffers
|
177
|
-
requirement: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
|
-
requirements:
|
180
|
-
- - ! '>='
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
version: '0'
|
183
|
-
type: :runtime
|
184
|
-
prerelease: false
|
185
|
-
version_requirements: !ruby/object:Gem::Requirement
|
186
|
-
none: false
|
187
|
-
requirements:
|
188
|
-
- - ! '>='
|
189
|
-
- !ruby/object:Gem::Version
|
190
|
-
version: '0'
|
191
175
|
- !ruby/object:Gem::Dependency
|
192
176
|
name: pry-editline
|
193
177
|
requirement: !ruby/object:Gem::Requirement
|
@@ -285,7 +269,7 @@ dependencies:
|
|
285
269
|
- !ruby/object:Gem::Version
|
286
270
|
version: '0'
|
287
271
|
- !ruby/object:Gem::Dependency
|
288
|
-
name: awesome_print
|
272
|
+
name: pry-awesome_print
|
289
273
|
requirement: !ruby/object:Gem::Requirement
|
290
274
|
none: false
|
291
275
|
requirements:
|
@@ -300,10 +284,15 @@ dependencies:
|
|
300
284
|
- - ! '>='
|
301
285
|
- !ruby/object:Gem::Version
|
302
286
|
version: '0'
|
303
|
-
description:
|
287
|
+
description: pry-debugger + pry-stack_explorer + pry-rescue + pry-exception_explorer
|
288
|
+
+ pry-remote-em + pry-doc + pry-theme + pry-pretty-numeric + pry-syntax-hacks +
|
289
|
+
pry-highlight + pry-editline + pry-git + pry-developer_tools + plymouth + bond +
|
290
|
+
jist + pry-awesome_print
|
304
291
|
email: rking-pry-full@sharpsaw.org
|
305
292
|
executables:
|
306
293
|
- demo-pry-rescue
|
294
|
+
- demo-pry-bond
|
295
|
+
- pryq
|
307
296
|
- demo-pry-exception_explorer
|
308
297
|
extensions: []
|
309
298
|
extra_rdoc_files: []
|
@@ -311,6 +300,10 @@ files:
|
|
311
300
|
- lib/pry-full.rb
|
312
301
|
- !binary |-
|
313
302
|
YmluL2RlbW8tcHJ5LXJlc2N1ZQ==
|
303
|
+
- !binary |-
|
304
|
+
YmluL2RlbW8tcHJ5LWJvbmQ=
|
305
|
+
- !binary |-
|
306
|
+
YmluL3ByeXE=
|
314
307
|
- !binary |-
|
315
308
|
YmluL2RlbW8tcHJ5LWV4Y2VwdGlvbl9leHBsb3Jlcg==
|
316
309
|
homepage: https://github.com/rking/pry-full
|
@@ -336,6 +329,6 @@ rubyforge_project:
|
|
336
329
|
rubygems_version: 1.8.24
|
337
330
|
signing_key:
|
338
331
|
specification_version: 3
|
339
|
-
summary:
|
332
|
+
summary: A metagem; Pry + bunch of pry plugins that get the brainstorming going
|
340
333
|
test_files: []
|
341
334
|
has_rdoc:
|