A ScriptInterface is used when we are reading debugger commands from a command-file rather than an interactive user. Command files appear in a users initialization script (e.g. .rdebugrc) and appear when running the debugger command source (Debugger::SourceCommand).
# File cli/ruby-debug/interface.rb, line 217 def initialize(file, out, verbose=false) super() @command_queue = [] @file = file.respond_to?(:gets) ? file : open(file) @out = out @verbose = verbose @history_save = false @history_length = 256 # take gdb default @histfile = '' end
# File cli/ruby-debug/interface.rb, line 256 def close @file.close end
confirm is called before performing a dangerous action. In running a debugger script, we don’t want to prompt, so we’ll pretend the user has unconditionally said “yes” and return String “y”.
# File cli/ruby-debug/interface.rb, line 248 def confirm(prompt) 'y' end
# File cli/ruby-debug/interface.rb, line 252 def print(*args) @out.printf(*args) end
Generated with the Darkfish Rdoc Generator 2.