| Class | Debugger::ScriptInterface |
| In: |
cli/ruby-debug/interface.rb
|
| Parent: | Interface |
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).
| command_queue | [RW] | |
| histfile | [RW] | |
| history_length | [RW] | |
| history_save | [RW] | |
| restart_file | [RW] |
# File cli/ruby-debug/interface.rb, line 217
217: def initialize(file, out, verbose=false)
218: super()
219: @command_queue = []
220: @file = file.respond_to?(:gets) ? file : open(file)
221: @out = out
222: @verbose = verbose
223: @history_save = false
224: @history_length = 256 # take gdb default
225: @histfile = ''
226: end
# File cli/ruby-debug/interface.rb, line 228
228: def read_command(prompt)
229: while result = @file.gets
230: puts "# #{result}" if @verbose
231: next if result =~ /^\s*#/
232: next if result.strip.empty?
233: break
234: end
235: raise IOError unless result
236: result.chomp!
237: end