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, #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, #interface, #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



26
27
28
# File 'lib/byebug/processors/script_processor.rb', line 26

def after_repl
  interface.close
end

#commandsObject

Available commands



11
12
13
# File 'lib/byebug/processors/script_processor.rb', line 11

def commands
  super.select(&:allow_in_control)
end

#promptObject

Prompt shown before reading a command.



33
34
35
# File 'lib/byebug/processors/script_processor.rb', line 33

def prompt
  '(byebug:ctrl) '
end

#replObject



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

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