ruby-debug-completion 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemspec +2 -2
- data/CHANGELOG.rdoc +4 -0
- data/README.rdoc +61 -26
- data/deps.rip +1 -1
- data/lib/ruby-debug/completion.rb +9 -14
- metadata +9 -9
data/.gemspec
CHANGED
@@ -9,10 +9,10 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = "gabriel.horner@gmail.com"
|
10
10
|
s.homepage = "http://github.com/cldwalker/ruby-debug-completion"
|
11
11
|
s.summary = "Mission: autocomplete ruby-debug"
|
12
|
-
s.description = "Provides ruby-debug command and
|
12
|
+
s.description = "Provides ruby-debug command and command arguments completion with a completion system more powerful than irb's, compliments of bond."
|
13
13
|
s.required_rubygems_version = ">= 1.3.6"
|
14
14
|
s.rubyforge_project = 'tagaholic'
|
15
|
-
s.add_dependency 'bond', '>= 0.
|
15
|
+
s.add_dependency 'bond', '>= 0.3.0'
|
16
16
|
s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
|
17
17
|
s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
|
18
18
|
s.license = 'MIT'
|
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
== Description
|
2
2
|
|
3
|
-
Provides ruby-debug command and
|
3
|
+
Provides ruby-debug command and command arguments completion with a completion system
|
4
4
|
more powerful than irb's, compliments of {bond}[http://github.com/cldwalker/bond].
|
5
5
|
|
6
6
|
== Install
|
@@ -15,7 +15,7 @@ To have ruby-debug automatically use this gem:
|
|
15
15
|
|
16
16
|
echo "eval require 'ruby-debug/completion'" >> ~/.rdebugrc
|
17
17
|
|
18
|
-
|
18
|
+
Or to require in a script or application, place after your `require 'ruby-debug'` line:
|
19
19
|
|
20
20
|
require 'ruby-debug/completion'
|
21
21
|
|
@@ -29,20 +29,53 @@ Or if using rdebug:
|
|
29
29
|
|
30
30
|
== Usage
|
31
31
|
|
32
|
-
|
32
|
+
Let's autocomplete instance and local variables of the current binding as well as ruby-debug
|
33
|
+
commands:
|
34
|
+
|
35
|
+
186 end
|
36
|
+
187
|
37
|
+
188 def render
|
38
|
+
189 body = []
|
39
|
+
190 require 'ruby-debug'; debugger
|
40
|
+
=> 191 unless @rows.length == 0
|
41
|
+
192 setup_field_lengths
|
42
|
+
193 body += render_header
|
43
|
+
194 body += render_rows
|
44
|
+
195 body += render_footer
|
33
45
|
|
34
46
|
(rdb:1) [TAB]
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
47
|
+
@fields condition finish ps thread
|
48
|
+
@filter_classes continue frame putl tmate
|
49
|
+
@headers delete help quit trace
|
50
|
+
@options disable info reload undisplay
|
51
|
+
@rows display irb restart up
|
52
|
+
backtrace down list save var
|
53
|
+
body edit method set where
|
54
|
+
break enable next show
|
55
|
+
catch eval p source
|
56
|
+
completion_toggle exit pp step
|
57
|
+
|
58
|
+
(rdb:1) ca[TAB]
|
59
|
+
(rdb:1) catch
|
60
|
+
|
61
|
+
(rdb:1) @fie[TAB]
|
62
|
+
(rdb:1) @fields
|
63
|
+
|
64
|
+
(rdb:1) bo[TAB]
|
65
|
+
(rdb:1) body
|
66
|
+
|
67
|
+
Autocomplete methods of local and instance variables:
|
68
|
+
|
69
|
+
(rdb:1) @filter_classes.[TAB]
|
70
|
+
Display all 150 possibilities? (y or n)
|
40
71
|
|
41
|
-
|
42
|
-
|
72
|
+
(rdb:1) body.[TAB]
|
73
|
+
Display all 168 possibilities? (y or n)
|
43
74
|
|
44
|
-
What info does ruby-debug provide?
|
45
75
|
|
76
|
+
Autocomplete ruby-debug command arguments:
|
77
|
+
|
78
|
+
# What info does ruby-debug provide?
|
46
79
|
(rdb:1) info [TAB]
|
47
80
|
args display global_variables locals thread
|
48
81
|
breakpoints file instance_variables program threads
|
@@ -51,8 +84,7 @@ What info does ruby-debug provide?
|
|
51
84
|
(rdb: 1) info d[TAB]
|
52
85
|
(rdb: 1) info display
|
53
86
|
|
54
|
-
What settings can I change?
|
55
|
-
|
87
|
+
# What settings can I change?
|
56
88
|
(rdb:1) set [TAB]
|
57
89
|
annotate autolist forcestep linetrace width
|
58
90
|
args basename fullpath linetrace+
|
@@ -62,11 +94,12 @@ What settings can I change?
|
|
62
94
|
(rdb:1) set d[TAB]
|
63
95
|
(rdb:1) set debuggertesting
|
64
96
|
|
65
|
-
Since I have autoeval on,
|
97
|
+
Since I have autoeval on, why not autocomplete as if I'm in irb?
|
66
98
|
|
67
|
-
|
68
|
-
(rdb:1) completion_toggle
|
99
|
+
# Execute command provided by this gem
|
100
|
+
(rdb:1) completion_toggle # also aliased to ct
|
69
101
|
|
102
|
+
# irb-like completion has been enabled
|
70
103
|
(rdb:1) [TAB]
|
71
104
|
Display all 347 possibilities? (y or n)
|
72
105
|
|
@@ -84,13 +117,19 @@ See {bond}[http://github.com/cldwalker/bond] for all that you can autocomplete.
|
|
84
117
|
Can I go back to basic ruby-debug completion?
|
85
118
|
|
86
119
|
# Invoke completion_toggle again
|
87
|
-
(rdb:1)
|
120
|
+
(rdb:1) completion_toggle
|
121
|
+
|
88
122
|
(rdb:1) [TAB]
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
123
|
+
@fields condition finish ps thread
|
124
|
+
@filter_classes continue frame putl tmate
|
125
|
+
@headers delete help quit trace
|
126
|
+
@options disable info reload undisplay
|
127
|
+
@rows display irb restart up
|
128
|
+
backtrace down list save var
|
129
|
+
body edit method set where
|
130
|
+
break enable next show
|
131
|
+
catch eval p source
|
132
|
+
completion_toggle exit pp step
|
94
133
|
|
95
134
|
Please, can I just quit quickly without a prompt?
|
96
135
|
|
@@ -102,10 +141,6 @@ Please, can I just quit quickly without a prompt?
|
|
102
141
|
This gem doesn't have ruby-debug as a dependency since ruby-debug is split across two gems
|
103
142
|
(ruby-debug and ruby-debug19), dependent on ruby versions. This gem will work with either one.
|
104
143
|
|
105
|
-
== Todo
|
106
|
-
|
107
|
-
* Completion of local variable methods
|
108
|
-
|
109
144
|
== Bugs/Issues
|
110
145
|
|
111
146
|
Please report them {on github}[http://github.com/cldwalker/ruby-debug-completion/issues].
|
data/deps.rip
CHANGED
@@ -1 +1 @@
|
|
1
|
-
bond >=0.
|
1
|
+
bond >=0.3.0
|
@@ -4,7 +4,7 @@ require 'bond'
|
|
4
4
|
module Debugger
|
5
5
|
module Completion
|
6
6
|
extend self
|
7
|
-
VERSION = '0.
|
7
|
+
VERSION = '0.2.0'
|
8
8
|
COMMANDS = [ "backtrace", "break", "catch", "condition", "continue",
|
9
9
|
"delete", "disable", "display", "down", "edit", "enable", "eval", "exit",
|
10
10
|
"finish", "frame", "help", "info", "irb", "list", "method", "next",
|
@@ -15,7 +15,8 @@ module Debugger
|
|
15
15
|
COMMANDS << ['jump'] if RUBY_VERSION >= '1.9'
|
16
16
|
|
17
17
|
def start
|
18
|
-
Bond.start(:
|
18
|
+
Bond.start(:eval_binding=>lambda { Debugger::Completion.current_binding },
|
19
|
+
:default_mission=>lambda {|e| Debugger::Completion.default_action }) do
|
19
20
|
complete(:methods=>%w{catch cat}) { objects_of(Class).select {|e| e < StandardError } }
|
20
21
|
complete(:methods=>%w{disable enable}) { %w{breakpoints display} }
|
21
22
|
complete(:methods=>['help', 'h']) { Debugger::Completion.commands }
|
@@ -39,24 +40,18 @@ module Debugger
|
|
39
40
|
|
40
41
|
def default_action
|
41
42
|
completions = commands + ['completion_toggle']
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
completions += debugger_eval(eval_string) | Object.constants |
|
46
|
-
Bond::DefaultMission::ReservedWords
|
47
|
-
else
|
48
|
-
completions += debugger_eval("local_variables | instance_variables")
|
49
|
-
end
|
50
|
-
completions
|
43
|
+
completions += @irb_completion ? Bond::DefaultMission.completions + Object.constants :
|
44
|
+
Bond::Mission.current_eval("local_variables | instance_variables")
|
45
|
+
completions - ['__dbg_verbose_save']
|
51
46
|
end
|
52
47
|
|
53
|
-
def
|
54
|
-
|
55
|
-
eval string, bdg || TOPLEVEL_BINDING
|
48
|
+
def current_binding
|
49
|
+
(cmd = first_object(Debugger::Command)) && cmd.send(:get_binding) rescue nil
|
56
50
|
end
|
57
51
|
|
58
52
|
def first_object(klass)
|
59
53
|
ObjectSpace.each_object(klass) {|e| return e }
|
54
|
+
nil
|
60
55
|
end
|
61
56
|
|
62
57
|
def toggle_irb_completion
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-debug-completion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gabriel Horner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-27 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -29,12 +29,12 @@ dependencies:
|
|
29
29
|
hash: 19
|
30
30
|
segments:
|
31
31
|
- 0
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version: 0.
|
32
|
+
- 3
|
33
|
+
- 0
|
34
|
+
version: 0.3.0
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
|
-
description: Provides ruby-debug command and
|
37
|
+
description: Provides ruby-debug command and command arguments completion with a completion system more powerful than irb's, compliments of bond.
|
38
38
|
email: gabriel.horner@gmail.com
|
39
39
|
executables: []
|
40
40
|
|