Skip to content

Instantly share code, notes, and snippets.

@radamant
Created December 6, 2010 05:13
Show Gist options
  • Select an option

  • Save radamant/729909 to your computer and use it in GitHub Desktop.

Select an option

Save radamant/729909 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment