Class: Byebug::RemoteInterface

Inherits:
Interface show all
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

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

#closeObject



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
  fail IOError unless result

  result.chomp
end