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, #last_if_empty, #prepare_input, #print, #puts, #read_file, #read_input
Methods included from Helpers::FileHelper
#get_line, #get_lines, #n_lines, #normalize, #shortpath, #virtual_file?
Constructor Details
#initialize(socket) ⇒ RemoteInterface
Returns a new instance of RemoteInterface.
8 9 10 11 12 13 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 8 def initialize(socket) super() @input = socket @output = socket @error = socket end |
Instance Method Details
#close ⇒ Object
23 24 25 26 27 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 23 def close output.close rescue IOError errmsg('Error closing the interface...') end |
#confirm(prompt) ⇒ Object
19 20 21 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 19 def confirm(prompt) super("CONFIRM #{prompt}") end |
#read_command(prompt) ⇒ Object
15 16 17 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 15 def read_command(prompt) super("PROMPT #{prompt}") end |
#readline(prompt) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/byebug/interfaces/remote_interface.rb', line 29 def readline(prompt) output.puts(prompt) result = input.gets raise IOError unless result result.chomp end |