Class: Debugger::RemoteInterface
- Defined in:
- lib/ruby-debug-ide/interface.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#command_queue ⇒ Object
Returns the value of attribute command_queue.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(socket) ⇒ RemoteInterface
constructor
A new instance of RemoteInterface.
-
#non_blocking_gets ⇒ Object
Workaround for JRuby issue jira.codehaus.org/browse/JRUBY-2063.
- #print(*args) ⇒ Object
- #read_command ⇒ Object
Constructor Details
#initialize(socket) ⇒ RemoteInterface
Returns a new instance of RemoteInterface.
14 15 16 17 |
# File 'lib/ruby-debug-ide/interface.rb', line 14 def initialize(socket) @socket = socket @command_queue = Queue.new end |
Instance Attribute Details
#command_queue ⇒ Object
Returns the value of attribute command_queue.
12 13 14 |
# File 'lib/ruby-debug-ide/interface.rb', line 12 def command_queue @command_queue end |
Instance Method Details
#close ⇒ Object
29 30 31 32 |
# File 'lib/ruby-debug-ide/interface.rb', line 29 def close @socket.close rescue IOError, SystemCallError end |
#non_blocking_gets ⇒ Object
Workaround for JRuby issue jira.codehaus.org/browse/JRUBY-2063
35 36 37 38 39 40 41 |
# File 'lib/ruby-debug-ide/interface.rb', line 35 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) ⇒ Object
25 26 27 |
# File 'lib/ruby-debug-ide/interface.rb', line 25 def print(*args) @socket.printf(*args) end |
#read_command ⇒ Object
19 20 21 22 23 |
# File 'lib/ruby-debug-ide/interface.rb', line 19 def read_command result = non_blocking_gets raise IOError unless result result.chomp end |