Class: Capybara::Webkit::Connection
- Inherits:
-
Object
- Object
- Capybara::Webkit::Connection
- Defined in:
- lib/capybara/webkit/connection.rb
Constant Summary collapse
- SERVER_PATH =
File.("../../../../bin/webkit_server", __FILE__)
- WEBKIT_SERVER_START_TIMEOUT =
15
Instance Attribute Summary collapse
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #gets ⇒ Object
-
#initialize(options = {}) ⇒ Connection
constructor
A new instance of Connection.
- #print(string) ⇒ Object
- #puts(string) ⇒ Object
- #read(length) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Connection
Returns a new instance of Connection.
12 13 14 15 16 17 18 |
# File 'lib/capybara/webkit/connection.rb', line 12 def initialize( = {}) @socket_class = [:socket_class] || TCPSocket @stdout = .has_key?(:stdout) ? [:stdout] : $stdout @command = [:command] || SERVER_PATH start_server connect end |
Instance Attribute Details
#port ⇒ Object (readonly)
Returns the value of attribute port.
10 11 12 |
# File 'lib/capybara/webkit/connection.rb', line 10 def port @port end |
Instance Method Details
#gets ⇒ Object
28 29 30 |
# File 'lib/capybara/webkit/connection.rb', line 28 def gets @socket.gets end |
#print(string) ⇒ Object
24 25 26 |
# File 'lib/capybara/webkit/connection.rb', line 24 def print(string) @socket.print string end |
#puts(string) ⇒ Object
20 21 22 |
# File 'lib/capybara/webkit/connection.rb', line 20 def puts(string) @socket.puts string end |
#read(length) ⇒ Object
32 33 34 |
# File 'lib/capybara/webkit/connection.rb', line 32 def read(length) @socket.read(length) end |