Load handlers together with server

This commit is contained in:
Jonas Nicklas 2010-01-23 12:49:40 +01:00
parent d354ea4a8b
commit 7ce5752da3
2 changed files with 4 additions and 5 deletions

View File

@ -346,6 +346,8 @@ The following people have dedicated their time and effort to Capybara:
* Dan Dofter
* Thorbjørn Hermansen
* Louis T.
* Stephan Hagemann
* Graham Ashton
== License:

View File

@ -1,11 +1,6 @@
require 'uri'
require 'net/http'
require 'rack'
begin
require 'rack/handler/mongrel'
rescue LoadError
require 'rack/handler/webrick'
end
class Capybara::Server
class Identify
@ -52,8 +47,10 @@ class Capybara::Server
Timeout.timeout(10) do
Thread.new do
begin
require 'rack/handler/mongrel'
Rack::Handler::Mongrel.run(Identify.new(@app), :Port => port)
rescue LoadError
require 'rack/handler/webrick'
Rack::Handler::WEBrick.run(Identify.new(@app), :Port => port, :AccessLog => [])
end
end