Class: Byebug::RemoteInterface

Inherits:
Interface show all
Defined in:
lib/byebug/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.



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/byebug/interface.rb', line 123

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.



120
121
122
# File 'lib/byebug/interface.rb', line 120

def command_queue
  @command_queue
end

#histfileObject

Returns the value of attribute histfile.



120
121
122
# File 'lib/byebug/interface.rb', line 120

def histfile
  @histfile
end

#history_lengthObject

Returns the value of attribute history_length.



120
121
122
# File 'lib/byebug/interface.rb', line 120

def history_length
  @history_length
end

#history_saveObject

Returns the value of attribute history_save.



120
121
122
# File 'lib/byebug/interface.rb', line 120

def history_save
  @history_save
end

#restart_fileObject

Returns the value of attribute restart_file.



121
122
123
# File 'lib/byebug/interface.rb', line 121

def restart_file
  @restart_file
end

Instance Method Details

#closeObject



139
140
141
142
# File 'lib/byebug/interface.rb', line 139

def close
  @socket.close
rescue Exception
end

#confirm(prompt) ⇒ Object



144
145
146
# File 'lib/byebug/interface.rb', line 144

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

#finalizeObject



148
149
# File 'lib/byebug/interface.rb', line 148

def finalize
end


159
160
161
# File 'lib/byebug/interface.rb', line 159

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

#read_command(prompt) ⇒ Object



151
152
153
# File 'lib/byebug/interface.rb', line 151

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

#readline_support?Boolean

Returns:

  • (Boolean)


155
156
157
# File 'lib/byebug/interface.rb', line 155

def readline_support?
  false
end