Class: TestInterface
- Inherits:
-
Debugger::Interface
- Object
- Debugger::Interface
- TestInterface
- Defined in:
- lib/debugger/test/test_interface.rb
Instance Attribute Summary collapse
-
#command_queue ⇒ Object
Returns the value of attribute command_queue.
-
#confirm_queue ⇒ Object
readonly
Returns the value of attribute confirm_queue.
-
#error_queue ⇒ Object
readonly
Returns the value of attribute error_queue.
-
#histfile ⇒ Object
Returns the value of attribute histfile.
-
#history_length ⇒ Object
Returns the value of attribute history_length.
-
#history_save ⇒ Object
Returns the value of attribute history_save.
-
#input_queue ⇒ Object
readonly
Returns the value of attribute input_queue.
-
#output_queue ⇒ Object
readonly
Returns the value of attribute output_queue.
-
#print_queue ⇒ Object
Returns the value of attribute print_queue.
-
#readline_support ⇒ Object
Returns the value of attribute readline_support.
-
#restart_file ⇒ Object
Returns the value of attribute restart_file.
-
#test_block ⇒ Object
Returns the value of attribute test_block.
Attributes inherited from Debugger::Interface
Instance Method Summary collapse
- #close ⇒ Object
- #confirm(message) ⇒ Object
- #empty? ⇒ Boolean
- #errmsg(value) ⇒ Object
- #finalize ⇒ Object
-
#initialize ⇒ TestInterface
constructor
A new instance of TestInterface.
- #inspect ⇒ Object
- #print(value) ⇒ Object
- #read_command(*args) ⇒ Object
- #readline_support? ⇒ Boolean
Methods inherited from Debugger::Interface
Constructor Details
#initialize ⇒ TestInterface
Returns a new instance of TestInterface.
5 6 7 8 9 10 11 12 13 |
# File 'lib/debugger/test/test_interface.rb', line 5 def initialize @input_queue = [] @output_queue = [] @error_queue = [] @confirm_queue = [] @command_queue = [] @print_queue = [] @readline_support = false end |
Instance Attribute Details
#command_queue ⇒ Object
Returns the value of attribute command_queue.
3 4 5 |
# File 'lib/debugger/test/test_interface.rb', line 3 def command_queue @command_queue end |
#confirm_queue ⇒ Object (readonly)
Returns the value of attribute confirm_queue.
2 3 4 |
# File 'lib/debugger/test/test_interface.rb', line 2 def confirm_queue @confirm_queue end |
#error_queue ⇒ Object (readonly)
Returns the value of attribute error_queue.
2 3 4 |
# File 'lib/debugger/test/test_interface.rb', line 2 def error_queue @error_queue end |
#histfile ⇒ Object
Returns the value of attribute histfile.
4 5 6 |
# File 'lib/debugger/test/test_interface.rb', line 4 def histfile @histfile end |
#history_length ⇒ Object
Returns the value of attribute history_length.
4 5 6 |
# File 'lib/debugger/test/test_interface.rb', line 4 def history_length @history_length end |
#history_save ⇒ Object
Returns the value of attribute history_save.
4 5 6 |
# File 'lib/debugger/test/test_interface.rb', line 4 def history_save @history_save end |
#input_queue ⇒ Object (readonly)
Returns the value of attribute input_queue.
2 3 4 |
# File 'lib/debugger/test/test_interface.rb', line 2 def input_queue @input_queue end |
#output_queue ⇒ Object (readonly)
Returns the value of attribute output_queue.
2 3 4 |
# File 'lib/debugger/test/test_interface.rb', line 2 def output_queue @output_queue end |
#print_queue ⇒ Object
Returns the value of attribute print_queue.
3 4 5 |
# File 'lib/debugger/test/test_interface.rb', line 3 def print_queue @print_queue end |
#readline_support ⇒ Object
Returns the value of attribute readline_support.
4 5 6 |
# File 'lib/debugger/test/test_interface.rb', line 4 def readline_support @readline_support end |
#restart_file ⇒ Object
Returns the value of attribute restart_file.
4 5 6 |
# File 'lib/debugger/test/test_interface.rb', line 4 def restart_file @restart_file end |
#test_block ⇒ Object
Returns the value of attribute test_block.
3 4 5 |
# File 'lib/debugger/test/test_interface.rb', line 3 def test_block @test_block end |
Instance Method Details
#close ⇒ Object
44 45 |
# File 'lib/debugger/test/test_interface.rb', line 44 def close end |
#confirm(message) ⇒ Object
32 33 34 35 |
# File 'lib/debugger/test/test_interface.rb', line 32 def confirm() @confirm_queue << read_command end |
#empty? ⇒ Boolean
47 48 49 |
# File 'lib/debugger/test/test_interface.rb', line 47 def empty? [input_queue, output_queue, error_queue, confirm_queue, print_queue].all?(&:empty?) end |
#errmsg(value) ⇒ Object
15 16 17 |
# File 'lib/debugger/test/test_interface.rb', line 15 def errmsg(value) @error_queue << value end |
#finalize ⇒ Object
41 42 |
# File 'lib/debugger/test/test_interface.rb', line 41 def finalize end |
#inspect ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/debugger/test/test_interface.rb', line 51 def inspect [ "input_queue: #{input_queue.inspect}", "output_queue: #{output_queue.inspect}", "error_queue: #{error_queue.inspect}", "confirm_queue: #{confirm_queue.inspect}", "print_queue: #{print_queue.inspect}" ].join("\n") end |
#print(value) ⇒ Object
28 29 30 |
# File 'lib/debugger/test/test_interface.rb', line 28 def print(value) @output_queue << value end |
#read_command(*args) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/debugger/test/test_interface.rb', line 19 def read_command(*args) if @input_queue.empty? && test_block test_block.call self.test_block = nil end result = @input_queue.shift result.is_a?(Proc) ? result.call : result end |
#readline_support? ⇒ Boolean
37 38 39 |
# File 'lib/debugger/test/test_interface.rb', line 37 def readline_support? @readline_support end |