Class: CypressRails::Server
- Inherits:
-
Object
- Object
- CypressRails::Server
- Extended by:
- Forwardable
- Defined in:
- lib/cypress_rails/server.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#log_path ⇒ Object
readonly
Returns the value of attribute log_path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(host, command, log_path) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
Constructor Details
#initialize(host, command, log_path) ⇒ Server
Returns a new instance of Server.
11 12 13 14 15 16 |
# File 'lib/cypress_rails/server.rb', line 11 def initialize(host, command, log_path) @host = host @port = find_free_port @command = command @log_path = log_path end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
9 10 11 |
# File 'lib/cypress_rails/server.rb', line 9 def command @command end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
9 10 11 |
# File 'lib/cypress_rails/server.rb', line 9 def host @host end |
#log_path ⇒ Object (readonly)
Returns the value of attribute log_path.
9 10 11 |
# File 'lib/cypress_rails/server.rb', line 9 def log_path @log_path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
9 10 11 |
# File 'lib/cypress_rails/server.rb', line 9 def port @port end |
Instance Method Details
#start ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/cypress_rails/server.rb', line 18 def start spawn_server until server_responsive? sleep 0.1 end yield(host, port) if block_given? ensure stop_server end |