class Debugger::SourceCommand

Implements debugger “source” command.

Public Class Methods

help(cmd) click to toggle source
# File lib/ruby-debug/commands/source.rb, line 28
def help(cmd)
  %Q{
    source FILE\texecutes a file containing debugger commands
  }
end
help_command() click to toggle source
# File lib/ruby-debug/commands/source.rb, line 24
def help_command
  'source'
end

Public Instance Methods

execute() click to toggle source
# File lib/ruby-debug/commands/source.rb, line 10
def execute
  file = File.expand_path(@match[1]).strip
  unless File.exist?(file)
    errmsg "Command file '#{file}' is not found\n"
    return
  end
  if @state and @state.interface
    @state.interface.command_queue += File.open(file).readlines
  else
    Debugger.run_script(file, @state)
  end
end
regexp() click to toggle source
# File lib/ruby-debug/commands/source.rb, line 6
def regexp
  %r^\s* so(?:urce)? \s+ (.+) $/
end