Sha256: 16d8230f089a122f56ce5fe9a89e5ec8c6fd656f9df5714515830b39c18719ec
Contents?: true
Size: 606 Bytes
Versions: 15
Compression:
Stored size: 606 Bytes
Contents
module Capybara::Poltergeist class Server attr_reader :socket, :fixed_port, :timeout def initialize(fixed_port = nil, timeout = nil) @fixed_port = fixed_port @timeout = timeout start end def port @socket.port end def timeout=(sec) @timeout = @socket.timeout = sec end def start @socket = WebSocketServer.new(fixed_port, timeout) end def stop @socket.close end def restart stop start end def send(message) @socket.send(message) or raise DeadClient.new(message) end end end
Version data entries
15 entries across 15 versions & 3 rubygems