Class: Webrat::Selenium::ApplicationServers::Base
- Inherits:
-
Object
- Object
- Webrat::Selenium::ApplicationServers::Base
show all
- Includes:
- SilenceStream
- Defined in:
- lib/webrat/selenium/application_servers/base.rb
Instance Method Summary
(collapse)
#silence_stream
Instance Method Details
9
10
11
12
13
|
# File 'lib/webrat/selenium/application_servers/base.rb', line 9
def boot
start
wait
stop_at_exit
end
|
- (Object) prepare_pid_file(file_path, pid_file_name)
38
39
40
41
|
# File 'lib/webrat/selenium/application_servers/base.rb', line 38
def prepare_pid_file(file_path, pid_file_name)
FileUtils.mkdir_p File.expand_path(file_path)
File.expand_path("#{file_path}/#{pid_file_name}")
end
|
- (Object) stop_at_exit
15
16
17
18
19
|
# File 'lib/webrat/selenium/application_servers/base.rb', line 15
def stop_at_exit
at_exit do
stop
end
end
|
21
22
23
24
25
|
# File 'lib/webrat/selenium/application_servers/base.rb', line 21
def wait
$stderr.print "==> Waiting for #{Webrat.configuration.application_framework} application server on port #{Webrat.configuration.application_port}... "
wait_for_socket
$stderr.print "Ready!\n"
end
|
- (Object) wait_for_socket
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/webrat/selenium/application_servers/base.rb', line 27
def wait_for_socket
silence_stream(STDOUT) do
TCPSocket.wait_for_service_with_timeout \
:host => "0.0.0.0",
:port => Webrat.configuration.application_port.to_i,
:timeout => 30 end
rescue SocketError
fail
end
|