Sha256: b6b8b4f826c903db87726756ed3572a8e85793945f5c8855da8b887680f5b34f

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

class TCPSocket
  
  # Workaround for JRuby issue http://jira.codehaus.org/browse/JRUBY-2063
  def non_blocking_gets
    loop do
      result, _, _ = IO.select( [self], nil, nil, 0.2 )
      next unless result
      return result[0].gets
    end
  end
  
end

module Debugger  
  class Interface
  end

  class LocalInterface < Interface
  end


  class RemoteInterface < Interface # :nodoc:
    attr_accessor :command_queue

    def initialize(socket)
      @socket = socket
      @command_queue = []
    end
    
    def read_command
      result = @socket.non_blocking_gets
      raise IOError unless result
      result.chomp
    end

    def print(*args)
      @socket.printf(*args)
    end
    
    def close
      @socket.close
    rescue Exception
    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-debug-ide-0.4.17.beta8 lib/ruby-debug/interface.rb
ruby-debug-ide-0.4.17.beta6 lib/ruby-debug/interface.rb
ruby-debug-ide-0.4.17.beta5 lib/ruby-debug/interface.rb