Sha256: 93e216fbd5d3fc63ed2e06929ad9f7956f9cecd2b73d5790e2299733ed518552
Contents?: true
Size: 1.17 KB
Versions: 17
Compression:
Stored size: 1.17 KB
Contents
class TestInterface < Byebug::Interface attr_reader :input_queue, :output_queue, :error_queue, :confirm_queue attr_accessor :command_queue, :histfile, :history_length, :history_save attr_accessor :readline_support, :restart_file, :test_block def initialize @input_queue = [] @output_queue = [] @error_queue = [] @confirm_queue = [] @command_queue = [] @readline_support = false end def errmsg(*args) @error_queue << format(*args) end def read_command(*args) if @input_queue.empty? if test_block test_block.call self.test_block = nil end else result = @input_queue.shift result.is_a?(Proc) ? result.call : result end end def print(*args) @output_queue << format(*args) end def confirm(message) @confirm_queue << message read_command message end def readline_support? @readline_support end def finalize end def close end def inspect [ "input_queue: #{input_queue.inspect}", "output_queue: #{output_queue.inspect}", "error_queue: #{error_queue.inspect}", "confirm_queue: #{confirm_queue.inspect}" ].join("\n") end end
Version data entries
17 entries across 17 versions & 2 rubygems