Module: Rack::Handler

Defined in:
lib/jasmine/server.rb

Class Method Summary collapse

Class Method Details

.default(options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/jasmine/server.rb', line 6

def self.default(options = {})
  # Guess.
  if ENV.include?("PHP_FCGI_CHILDREN")
    # We already speak FastCGI
    options.delete :File
    options.delete :Port

    Rack::Handler::FastCGI
  elsif ENV.include?("REQUEST_METHOD")
    Rack::Handler::CGI
  else
    begin
      Rack::Handler::Mongrel
    rescue LoadError => e
      Rack::Handler::WEBrick
    end
  end
end