Class: Capybara::Driver::Webkit::RemoteConnection

Inherits:
Connection
  • Object
show all
Defined in:
lib/capybara/driver/webkit/remote_browser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(remote_host, remote_port, options) ⇒ RemoteConnection

Returns a new instance of RemoteConnection.



11
12
13
14
15
16
# File 'lib/capybara/driver/webkit/remote_browser.rb', line 11

def initialize(remote_host, remote_port, options)
  @remote_host = remote_host
  @remote_port = remote_port
  super(options)
  Capybara::Driver::Webkit::RemoteConnection.open_sockets << @socket
end

Class Method Details

.open_socketsObject



3
# File 'lib/capybara/driver/webkit/remote_browser.rb', line 3

def self.open_sockets; @@_sockets ||= [ ]; end

Instance Method Details

#attempt_connectObject



23
24
25
26
# File 'lib/capybara/driver/webkit/remote_browser.rb', line 23

def attempt_connect
  @socket = @socket_class.open(@remote_host, @remote_port)
  rescue Errno::ECONNREFUSED
end

#closeObject



17
18
19
20
21
# File 'lib/capybara/driver/webkit/remote_browser.rb', line 17

def close
  @socket.close rescue nil
  Capybara::Driver::Webkit::RemoteConnection.open_sockets.delete(@socket)
  true
end

#start_serverObject



22
# File 'lib/capybara/driver/webkit/remote_browser.rb', line 22

def start_server ; end