Class: Byebug::ScriptProcessor
- Inherits:
-
CommandProcessor
- Object
- CommandProcessor
- Byebug::ScriptProcessor
- Defined in:
- lib/byebug/processors/script_processor.rb
Overview
Processes commands from a file
Instance Attribute Summary
Attributes inherited from CommandProcessor
Instance Method Summary collapse
-
#commands ⇒ Object
Available commands.
- #process_commands ⇒ Object
-
#prompt ⇒ Object
Prompt shown before reading a command.
Methods inherited from CommandProcessor
#at_breakpoint, #at_catchpoint, #at_end, #at_line, #at_return, #at_tracing, #command_list, #initialize, #interface, #printer, #proceed!
Methods included from Helpers::EvalHelper
#error_eval, #multiple_thread_eval, #separate_thread_eval, #silent_eval, #warning_eval
Constructor Details
This class inherits a constructor from Byebug::CommandProcessor
Instance Method Details
#commands ⇒ Object
Available commands
11 12 13 |
# File 'lib/byebug/processors/script_processor.rb', line 11 def commands super.select(&:allow_in_control) end |
#process_commands ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/byebug/processors/script_processor.rb', line 15 def process_commands while (input = interface.read_command(prompt)) command = command_list.match(input) if command command.new(self, input).execute else errmsg('Unknown command') end end interface.close rescue IOError, SystemCallError interface.close rescue without_exceptions do puts "INTERNAL ERROR!!! #{$ERROR_INFO}" puts $ERROR_INFO.backtrace.map { |l| " #{l}" }.join("\n") end end |
#prompt ⇒ Object
Prompt shown before reading a command.
39 40 41 |
# File 'lib/byebug/processors/script_processor.rb', line 39 def prompt '(byebug:ctrl) ' end |