Class: Byebug::RemoteInterface
- Defined in:
- lib/byebug/interfaces/remote_interface.rb
Overview
Interface class for remote use of byebug.
Instance Attribute Summary
Attributes inherited from Interface
#command_queue, #error, #history, #input, #output
Instance Method Summary collapse
- #close ⇒ Object
- #confirm(prompt) ⇒ Object
-
#initialize(socket) ⇒ RemoteInterface
constructor
A new instance of RemoteInterface.
- #read_command(prompt) ⇒ Object
- #readline(prompt) ⇒ Object
Methods inherited from Interface
#autorestore, #autosave, #errmsg, #print, #puts, #read_file, #read_input
Methods included from FileFunctions
#get_line, #get_lines, #n_lines, #normalize
Constructor Details
#initialize(socket) ⇒ RemoteInterface
Returns a new instance of RemoteInterface.
8 9 10 11 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 8 def initialize(socket) super() @input, @output, @error = socket, socket, socket end |
Instance Method Details
#close ⇒ Object
21 22 23 24 25 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 21 def close output.close rescue IOError errmsg('Error closing the interface...') end |
#confirm(prompt) ⇒ Object
17 18 19 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 17 def confirm(prompt) super("CONFIRM #{prompt}") end |
#read_command(prompt) ⇒ Object
13 14 15 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 13 def read_command(prompt) super("PROMPT #{prompt}") end |
#readline(prompt) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 27 def readline(prompt) output.puts(prompt) result = input.gets fail IOError unless result result.chomp end |