From 20e32d9d4a7ccea3ca07e5460671b475b4184929 Mon Sep 17 00:00:00 2001 From: Jonas Nicklas Date: Fri, 26 Feb 2010 09:04:45 +0100 Subject: [PATCH] Darrin Holst to contributors --- README.rdoc | 1 + lib/capybara/server.rb | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.rdoc b/README.rdoc index ef22bd3d..6042ed3c 100644 --- a/README.rdoc +++ b/README.rdoc @@ -377,6 +377,7 @@ The following people have dedicated their time and effort to Capybara: * Pavel Gabriel * Bodaniel Jeanes * Carl Porth +* Darrin Holst == License: diff --git a/lib/capybara/server.rb b/lib/capybara/server.rb index 3723547b..5d2840a3 100644 --- a/lib/capybara/server.rb +++ b/lib/capybara/server.rb @@ -59,16 +59,18 @@ class Capybara::Server Capybara.log "application has already booted" and return self if responsive? Capybara.log "booting Rack applicartion on port #{port}" - Timeout.timeout(10) do - Thread.new do - handler.run(Identify.new(@app), :Port => port, :AccessLog => []) - end - Capybara.log "checking if application has booted" + Thread.new do + handler.run(Identify.new(@app), :Port => port, :AccessLog => []) + end + Capybara.log "checking if application has booted" - loop do - Capybara.log("application has booted") and break if responsive? - Capybara.log("waiting for application to boot...") + Capybara::WaitUntil.timeout(10) do + if responsive? + Capybara.log("application has booted") + true + else sleep 0.5 + false end end self