# File lib/webrat/selenium/application_servers/rack.rb, line 22 def fail $stderr.puts $stderr.puts $stderr.puts "==> Failed to boot the application server... exiting!" $stderr.puts $stderr.puts "Verify you can start a server on port #{Webrat.configuration.application_port} with the following command:" $stderr.puts $stderr.puts " #{start_command}" exit end
# File lib/webrat/selenium/application_servers/rack.rb, line 8 def start @pid = fork do if File.exist?("log") redirect_io(STDOUT, File.join("log", "webrat.webrick.stdout.log")) redirect_io(STDERR, File.join("log", "webrat.webrick.stderr.log")) end exec start_command end end
# File lib/webrat/selenium/application_servers/rack.rb, line 33 def start_command "#{bundler} rackup -s webrick --port #{Webrat.configuration.application_port} --env #{Webrat.configuration.application_environment}".strip end
# File lib/webrat/selenium/application_servers/rack.rb, line 18 def stop Process.kill("INT", @pid) end
# File lib/webrat/selenium/application_servers/rack.rb, line 39 def bundler File.exist?("./Gemfile") ? "bundle exec " : "" end
# File lib/webrat/selenium/application_servers/rack.rb, line 43 def redirect_io(io, path) File.open(path, 'ab') { |fp| io.reopen(fp) } if path io.sync = true end