Class: Byebug::RemoteInterface

Inherits:
Interface show all
Defined in:
lib/byebug/interfaces/remote_interface.rb

Instance Attribute Summary collapse

Attributes inherited from Interface

#have_readline

Instance Method Summary collapse

Methods inherited from Interface

#errmsg, #escape, #format

Constructor Details

#initialize(socket) ⇒ RemoteInterface

Returns a new instance of RemoteInterface.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/byebug/interfaces/remote_interface.rb', line 6

def initialize(socket)
  @command_queue = []
  @socket = socket
  @history_save = false
  @history_length = 256
  @histfile = ''
  # Do we read the histfile?
  # open(@histfile, 'r') do |file|
  #   file.each do |line|
  #     line.chomp!
  #     Readline::HISTORY << line
  #   end
  # end if File.exist?(@histfile)
    @restart_file = nil
end

Instance Attribute Details

#command_queueObject

Returns the value of attribute command_queue.



3
4
5
# File 'lib/byebug/interfaces/remote_interface.rb', line 3

def command_queue
  @command_queue
end

#histfileObject

Returns the value of attribute histfile.



3
4
5
# File 'lib/byebug/interfaces/remote_interface.rb', line 3

def histfile
  @histfile
end

#history_lengthObject

Returns the value of attribute history_length.



3
4
5
# File 'lib/byebug/interfaces/remote_interface.rb', line 3

def history_length
  @history_length
end

#history_saveObject

Returns the value of attribute history_save.



3
4
5
# File 'lib/byebug/interfaces/remote_interface.rb', line 3

def history_save
  @history_save
end

#restart_fileObject

Returns the value of attribute restart_file.



4
5
6
# File 'lib/byebug/interfaces/remote_interface.rb', line 4

def restart_file
  @restart_file
end

Instance Method Details

#closeObject



22
23
24
25
# File 'lib/byebug/interfaces/remote_interface.rb', line 22

def close
  @socket.close
rescue Exception
end

#confirm(prompt) ⇒ Object



27
28
29
# File 'lib/byebug/interfaces/remote_interface.rb', line 27

def confirm(prompt)
  send_command "CONFIRM #{prompt}"
end

#finalizeObject



31
32
# File 'lib/byebug/interfaces/remote_interface.rb', line 31

def finalize
end


42
43
44
# File 'lib/byebug/interfaces/remote_interface.rb', line 42

def print(*args)
  @socket.printf(escape(format(*args)))
end

#read_command(prompt) ⇒ Object



34
35
36
# File 'lib/byebug/interfaces/remote_interface.rb', line 34

def read_command(prompt)
  send_command "PROMPT #{prompt}"
end

#readline_support?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/byebug/interfaces/remote_interface.rb', line 38

def readline_support?
  false
end