Class: Debugger::ScriptCommand
- Inherits:
-
Command
- Object
- Command
- Debugger::ScriptCommand
show all
- Defined in:
- lib/ruby-debug/commands/script.rb
Overview
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, inherited, #initialize, load_commands, #match, method_missing, options
Class Method Details
.help(cmd) ⇒ Object
22
23
24
25
26
|
# File 'lib/ruby-debug/commands/script.rb', line 22
def help(cmd)
%{
script FILE\texecutes a script file
}
end
|
.help_command ⇒ Object
18
19
20
|
# File 'lib/ruby-debug/commands/script.rb', line 18
def help_command
'script'
end
|
Instance Method Details
#execute ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/ruby-debug/commands/script.rb', line 9
def execute
unless File.exists?(@match[1])
print "Script file '#{@match[1]}' is not found\n"
return
end
Debugger.run_script(@match[1], @state)
end
|
#regexp ⇒ Object
5
6
7
|
# File 'lib/ruby-debug/commands/script.rb', line 5
def regexp
/^\s*sc(?:ript)?\s+(.+)$/
end
|