Class: Debugger::RemoteInterface
- Defined in:
- lib/ruby-debug-ide/interface.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#closing ⇒ Object
Returns the value of attribute closing.
-
#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.
15 16 17 18 19 |
# File 'lib/ruby-debug-ide/interface.rb', line 15 def initialize(socket) @socket = socket @command_queue = Queue.new @closing = false end |
Instance Attribute Details
#closing ⇒ Object
Returns the value of attribute closing.
13 14 15 |
# File 'lib/ruby-debug-ide/interface.rb', line 13 def closing @closing end |
#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
31 32 33 34 |
# File 'lib/ruby-debug-ide/interface.rb', line 31 def close @socket.close rescue IOError, SystemCallError end |
#non_blocking_gets ⇒ Object
Workaround for JRuby issue jira.codehaus.org/browse/JRUBY-2063
37 38 39 40 41 42 43 |
# File 'lib/ruby-debug-ide/interface.rb', line 37 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
27 28 29 |
# File 'lib/ruby-debug-ide/interface.rb', line 27 def print(*args) @socket.printf(*args) unless (@closing && ENV['DEBUGGER_KEEP_PROCESS_ALIVE']) end |
#read_command ⇒ Object
21 22 23 24 25 |
# File 'lib/ruby-debug-ide/interface.rb', line 21 def read_command result = non_blocking_gets raise IOError unless result result.chomp end |