pry-plus-byebug 1.0.2
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.
- checksums.yaml +7 -0
- data/bin/console +14 -0
- data/bin/demo-pry-bond +86 -0
- data/bin/demo-pry-exception_explorer +26 -0
- data/bin/demo-pry-rescue +29 -0
- data/bin/pryq +4 -0
- data/bin/setup +7 -0
- data/lib/pry-plus.rb +3 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 38e13d90015a26e5379362dc41f286e30f5e7bb1
|
4
|
+
data.tar.gz: 50c4d17aa7cda2ea39efb8f9da6962e3197a82d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 40605a59f932b7095cdbb9856c8f8cd80ea71ea26b7a7851bbe2355b36540a068a2b6681a1609d9006acf892571bbc922cf59208a3bebce5bd4ea74ea3c8233a
|
7
|
+
data.tar.gz: 74aa0bce9c42f35f66c8af1062795a562846aa49d1b4d459ee4757d35de869695a824b5f2e3dd20fe14e4064b5515d06cd711253c26855265e6821786e72e486
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "pry/plus/byebug"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
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
|
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?"
|
data/bin/pryq
ADDED
data/bin/setup
ADDED
data/lib/pry-plus.rb
ADDED
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pry-plus-byebug
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- "☈king"
|
8
|
+
- dresselm
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-05-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: pry-doc
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: pry-docmore
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: pry-byebug
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: pry-stack_explorer
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: pry-rescue
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: bond
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: jist
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
description: pry-doc + pry-docmore + pry-byebug + pry-stack_explorer + pry-rescue
|
113
|
+
+ bond + jist
|
114
|
+
email:
|
115
|
+
- rking-pry-plus@sharpsaw.org
|
116
|
+
- matt.dressel@avantcredit.com
|
117
|
+
executables:
|
118
|
+
- console
|
119
|
+
- demo-pry-exception_explorer
|
120
|
+
- demo-pry-rescue
|
121
|
+
- demo-pry-bond
|
122
|
+
- setup
|
123
|
+
- pryq
|
124
|
+
extensions: []
|
125
|
+
extra_rdoc_files: []
|
126
|
+
files:
|
127
|
+
- bin/console
|
128
|
+
- bin/demo-pry-bond
|
129
|
+
- bin/demo-pry-exception_explorer
|
130
|
+
- bin/demo-pry-rescue
|
131
|
+
- bin/pryq
|
132
|
+
- bin/setup
|
133
|
+
- lib/pry-plus.rb
|
134
|
+
homepage: https://github.com/avantcredit/pry-plus
|
135
|
+
licenses:
|
136
|
+
- CC0
|
137
|
+
metadata: {}
|
138
|
+
post_install_message:
|
139
|
+
rdoc_options: []
|
140
|
+
require_paths:
|
141
|
+
- lib
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
requirements: []
|
153
|
+
rubyforge_project:
|
154
|
+
rubygems_version: 2.2.2
|
155
|
+
signing_key:
|
156
|
+
specification_version: 4
|
157
|
+
summary: Pry + Essential Plugins + ByeBug
|
158
|
+
test_files: []
|
159
|
+
has_rdoc:
|