Sha256: 5ec1765ec3265c00a4c4d170075315bf6c074bd52d48577d7ed0b0179f24e05f

Contents?: true

Size: 801 Bytes

Versions: 62

Compression:

Stored size: 801 Bytes

Contents

require 'thread'

module Debugger
  class Interface
  end

  class LocalInterface < Interface
  end


  class RemoteInterface < Interface # :nodoc:
    attr_accessor :command_queue

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

    def print(*args)
      @socket.printf(*args)
    end
    
    def close
      @socket.close
    rescue IOError, SystemCallError
    end

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

  end
  
end

Version data entries

62 entries across 54 versions & 4 rubygems

Version Path
ruby-debug-ide-0.6.1.beta2 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.6.0 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.6.0.beta1 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.5.0 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.33 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.32 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.31 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.30 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.29 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.28 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.27 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.26 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.25 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.24 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.24.beta5 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.24.beta4 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.23 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.23.beta11 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.23.beta10 lib/ruby-debug-ide/interface.rb
ruby-debug-ide-0.4.23.beta9 lib/ruby-debug-ide/interface.rb