Load handlers together with server
This commit is contained in:
parent
d354ea4a8b
commit
7ce5752da3
|
@ -346,6 +346,8 @@ The following people have dedicated their time and effort to Capybara:
|
||||||
* Dan Dofter
|
* Dan Dofter
|
||||||
* Thorbjørn Hermansen
|
* Thorbjørn Hermansen
|
||||||
* Louis T.
|
* Louis T.
|
||||||
|
* Stephan Hagemann
|
||||||
|
* Graham Ashton
|
||||||
|
|
||||||
== License:
|
== License:
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
require 'uri'
|
require 'uri'
|
||||||
require 'net/http'
|
require 'net/http'
|
||||||
require 'rack'
|
require 'rack'
|
||||||
begin
|
|
||||||
require 'rack/handler/mongrel'
|
|
||||||
rescue LoadError
|
|
||||||
require 'rack/handler/webrick'
|
|
||||||
end
|
|
||||||
|
|
||||||
class Capybara::Server
|
class Capybara::Server
|
||||||
class Identify
|
class Identify
|
||||||
|
@ -52,8 +47,10 @@ class Capybara::Server
|
||||||
Timeout.timeout(10) do
|
Timeout.timeout(10) do
|
||||||
Thread.new do
|
Thread.new do
|
||||||
begin
|
begin
|
||||||
|
require 'rack/handler/mongrel'
|
||||||
Rack::Handler::Mongrel.run(Identify.new(@app), :Port => port)
|
Rack::Handler::Mongrel.run(Identify.new(@app), :Port => port)
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
|
require 'rack/handler/webrick'
|
||||||
Rack::Handler::WEBrick.run(Identify.new(@app), :Port => port, :AccessLog => [])
|
Rack::Handler::WEBrick.run(Identify.new(@app), :Port => port, :AccessLog => [])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue