Implements debugger “source” command.
# File cli/ruby-debug/commands/source.rb, line 36 def help(cmd) %Q{ source FILE\texecutes a file containing debugger commands } end
# File cli/ruby-debug/commands/source.rb, line 32 def help_command 'source' end
# File cli/ruby-debug/commands/source.rb, line 10 def execute if 3 == @match.size then verbose=true file=@match[2] else verbose=false file=@match[1] end file = File.expand_path(file).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, verbose) end end
# File cli/ruby-debug/commands/source.rb, line 6 def regexp %r^\s* so(?:urce)? (\s+ -v)? \s+ (.+) $/ end