Class: Webrat::Selenium::RailsApplicationServer

Inherits:
ApplicationServer show all
Defined in:
lib/webrat/selenium/rails_application_server.rb

Instance Method Summary collapse

Methods inherited from ApplicationServer

boot, #boot, #prepare_pid_file, #stop_at_exit, #wait, #wait_for_socket

Instance Method Details

#failObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/webrat/selenium/rails_application_server.rb', line 16

def fail
  $stderr.puts
  $stderr.puts
  $stderr.puts "==> Failed to boot the Rails application server... exiting!"
  $stderr.puts
  $stderr.puts "Verify you can start a Rails server on port #{Webrat.configuration.application_port} with the following command:"
  $stderr.puts
  $stderr.puts "    #{start_command}"
  exit
end

#pid_fileObject



27
28
29
# File 'lib/webrat/selenium/rails_application_server.rb', line 27

def pid_file
  prepare_pid_file("#{RAILS_ROOT}/tmp/pids", "mongrel_selenium.pid")
end

#startObject



6
7
8
# File 'lib/webrat/selenium/rails_application_server.rb', line 6

def start
  system start_command
end

#start_commandObject



31
32
33
# File 'lib/webrat/selenium/rails_application_server.rb', line 31

def start_command
  "mongrel_rails start -d --chdir='#{RAILS_ROOT}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &"
end

#stopObject



10
11
12
13
14
# File 'lib/webrat/selenium/rails_application_server.rb', line 10

def stop
  silence_stream(STDOUT) do
    system stop_command
  end
end

#stop_commandObject



35
36
37
# File 'lib/webrat/selenium/rails_application_server.rb', line 35

def stop_command
  "mongrel_rails stop -c #{RAILS_ROOT} --pid #{pid_file}"
end