Class: Byebug::ScriptProcessor

Inherits:
CommandProcessor show all
Defined in:
lib/byebug/processors/script_processor.rb

Overview

Processes commands from a file

Instance Attribute Summary

Attributes inherited from CommandProcessor

#context, #interface, #prev_line

Instance Method Summary collapse

Methods inherited from CommandProcessor

#at_breakpoint, #at_catchpoint, #at_end, #at_line, #at_return, #at_tracing, #command_list, #initialize, #printer, #proceed!, #process_commands

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

#after_replObject



28
29
30
31
32
# File 'lib/byebug/processors/script_processor.rb', line 28

def after_repl
  super

  interface.close
end

#commandsObject

Available commands



13
14
15
# File 'lib/byebug/processors/script_processor.rb', line 13

def commands
  super.select(&:allow_in_control)
end

#promptObject

Prompt shown before reading a command.



37
38
39
# File 'lib/byebug/processors/script_processor.rb', line 37

def prompt
  "(byebug:ctrl) "
end

#replObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/byebug/processors/script_processor.rb', line 17

def repl
  while (input = interface.read_command(prompt))
    safely do
      command = command_list.match(input)
      raise CommandNotFound.new(input) unless command

      command.new(self, input).execute
    end
  end
end