class DebuggerXml::Ide::Interface
Attributes
command_queue[RW]
histfile[RW]
history_length[RW]
history_save[RW]
restart_file[RW]
Public Class Methods
new(socket)
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 10 def initialize(socket) @command_queue = [] @socket = socket @history_save = false @history_length = 256 @histfile = '' @restart_file = nil end
Public Instance Methods
close()
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 19 def close @socket.close rescue Exception end
confirm(prompt)
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 32 def confirm(prompt) true end
errmsg(*args)
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 28 def errmsg(*args) print(*args) end
finalize()
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 36 def finalize close end
non_blocking_gets()
click to toggle source
Workaround for JRuby issue jira.codehaus.org/browse/JRUBY-2063
# File lib/debugger_xml/ide/interface.rb, line 41 def non_blocking_gets loop do result, _, _ = IO.select([@socket], nil, nil, 0.2) next unless result return result[0].gets end end
print(*args)
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 61 def print(*args) escaped_args = escape_input(args) value = escaped_args.first % escaped_args[1..-1] DebuggerXml.logger.puts("Going to print: #{value}") @socket.print(value) end
print_debug(msg)
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 24 def print_debug(msg) STDOUT.puts(msg) end
puts(*args)
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 68 def puts(*args) print(*args) end
read_command(*args)
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 49 def read_command(*args) result = non_blocking_gets raise IOError unless result result.chomp.tap do |r| DebuggerXml.logger.puts("Read command: #{r}") end end
readline_support?()
click to toggle source
# File lib/debugger_xml/ide/interface.rb, line 57 def readline_support? false end