Class: Debugger::Command
- Inherits:
-
Object
show all
- Defined in:
- lib/ruby-debug/command.rb
Overview
Direct Known Subclasses
AddBreakpoint, AddDisplayCommand, BreakpointsCommand, CatchCommand, ContinueCommand, DeleteBreakpointCommand, DeleteDisplayCommand, DisplayCommand, DownCommand, EvalCommand, FinishCommand, FrameCommand, HelpCommand, IRBCommand, InterruptCommand, ListCommand, MethodCommand, NextCommand, PPCommand, QuitCommand, ReloadCommand, RestartCommand, SaveCommand, ScriptCommand, SetCommand, StepCommand, TextMateCommand, ThreadCurrentCommand, ThreadListCommand, ThreadResumeCommand, ThreadStopCommand, ThreadSwitchCommand, TraceCommand, UpCommand, VarConstantCommand, VarGlobalCommand, VarInstanceCommand, VarLocalCommand, WhereCommand
Constant Summary
collapse
- DEF_OPTIONS =
{
:event => true,
:control => false,
:always_run => false,
:unknown => false,
:need_context => false,
}
- @@display_stack_trace =
false
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(state) ⇒ Command
Returns a new instance of Command.
49
50
51
|
# File 'lib/ruby-debug/command.rb', line 49
def initialize(state)
@state = state
end
|
Class Method Details
.commands ⇒ Object
4
5
6
|
# File 'lib/ruby-debug/command.rb', line 4
def commands
@commands ||= []
end
|
.inherited(klass) ⇒ Object
16
17
18
19
20
21
|
# File 'lib/ruby-debug/command.rb', line 16
def inherited(klass)
DEF_OPTIONS.each do |o, v|
klass.options[o] = v if klass.options[o].nil?
end
commands << klass
end
|
.load_commands ⇒ Object
23
24
25
26
27
28
|
# File 'lib/ruby-debug/command.rb', line 23
def load_commands
dir = File.dirname(__FILE__)
Dir[File.join(dir, 'commands', '*')].each do |file|
require file if file =~ /\.rb$/
end
end
|
.method_missing(meth, *args, &block) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/ruby-debug/command.rb', line 30
def method_missing(meth, *args, &block)
if meth.to_s =~ /^(.+?)=$/
@options[$1.intern] = args.first
else
if @options.has_key?(meth)
@options[meth]
else
super
end
end
end
|
.options ⇒ Object
42
43
44
|
# File 'lib/ruby-debug/command.rb', line 42
def options
@options ||= {}
end
|
Instance Method Details
#match(input) ⇒ Object
53
54
55
|
# File 'lib/ruby-debug/command.rb', line 53
def match(input)
@match = regexp.match(input)
end
|