Sha256: b4d4747f66a382c6c69397e8fc9c29eddee409c936f34351cf151bcd6b696619

Contents?: true

Size: 527 Bytes

Versions: 10

Compression:

Stored size: 527 Bytes

Contents

require 'socket'

module Auger
  class Project
    def socket(port, &block)
      @connections << Socket.load(port, &block)
    end
  end

  class Socket < Auger::Connection
    def open(host, options)
      TCPSocket.open(host, options[:port]) rescue false
    end

    def close(socket)
      socket.close if socket
    end

    def open?(&block)
      @requests << SocketRequest.load(nil, &block)
    end
  end

  class SocketRequest < Auger::Request
    def run(socket)
      socket ? true : false      
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
auger-1.3.5 lib/auger/plugin/socket.rb
auger-1.3.4 lib/auger/plugin/socket.rb
auger-1.3.3 lib/plugins/socket.rb
auger-1.3.2 lib/plugins/socket.rb
auger-1.3.1 lib/plugins/socket.rb
auger-1.3.0 lib/plugins/socket.rb
auger-1.2.4 lib/plugins/socket.rb
auger-1.2.3 lib/plugins/socket.rb
auger-1.2.2 lib/plugins/socket.rb
auger-1.2.0 lib/plugins/socket.rb