Class: Capybara::Driver::Webkit::RemoteConnection
- Inherits:
-
Connection
- Object
- Connection
- Capybara::Driver::Webkit::RemoteConnection
- Defined in:
- lib/capybara/driver/webkit/remote_browser.rb
Class Method Summary collapse
Instance Method Summary collapse
- #attempt_connect ⇒ Object
- #close ⇒ Object
-
#initialize(remote_host, remote_port, options) ⇒ RemoteConnection
constructor
A new instance of RemoteConnection.
- #start_server ⇒ Object
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, ) @remote_host = remote_host @remote_port = remote_port super() Capybara::Driver::Webkit::RemoteConnection.open_sockets << @socket end |
Class Method Details
.open_sockets ⇒ Object
3 |
# File 'lib/capybara/driver/webkit/remote_browser.rb', line 3 def self.open_sockets; @@_sockets ||= [ ]; end |
Instance Method Details
#attempt_connect ⇒ Object
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 |
#close ⇒ Object
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_server ⇒ Object
22 |
# File 'lib/capybara/driver/webkit/remote_browser.rb', line 22 def start_server ; end |