Sha256: df8915b61c827be5db6d2218c741edb21844efb1e1fa5f82409823bfa931c6f6

Contents?: true

Size: 1.53 KB

Versions: 18

Compression:

Stored size: 1.53 KB

Contents

module Rack
  # *Handlers* connect web servers with Rack.
  #
  # Rack includes Handlers for Mongrel, WEBrick, FastCGI, CGI, SCGI
  # and LiteSpeed.
  #
  # Handlers usually are activated by calling <tt>MyHandler.run(myapp)</tt>.
  # A second optional hash can be passed to include server-specific
  # configuration.
  module Handler
    def self.get(server)
      return unless server

      if klass = @handlers[server]
        obj = Object
        klass.split("::").each { |x| obj = obj.const_get(x) }
        obj
      else
        Rack::Handler.const_get(server.capitalize)
      end
    end

    def self.register(server, klass)
      @handlers ||= {}
      @handlers[server] = klass
    end

    autoload :CGI, "rack/handler/cgi"
    autoload :FastCGI, "rack/handler/fastcgi"
    autoload :Mongrel, "rack/handler/mongrel"
    autoload :EventedMongrel, "rack/handler/evented_mongrel"
    autoload :SwiftipliedMongrel, "rack/handler/swiftiplied_mongrel"
    autoload :WEBrick, "rack/handler/webrick"
    autoload :LSWS, "rack/handler/lsws"
    autoload :SCGI, "rack/handler/scgi"
    autoload :Thin, "rack/handler/thin"

    register 'cgi', 'Rack::Handler::CGI'
    register 'fastcgi', 'Rack::Handler::FastCGI'
    register 'mongrel', 'Rack::Handler::Mongrel'
    register 'emongrel', 'Rack::Handler::EventedMongrel'
    register 'smongrel', 'Rack::Handler::SwiftipliedMongrel'
    register 'webrick', 'Rack::Handler::WEBrick'
    register 'lsws', 'Rack::Handler::LSWS'
    register 'scgi', 'Rack::Handler::SCGI'
    register 'thin', 'Rack::Handler::Thin'
  end
end

Version data entries

18 entries across 18 versions & 10 rubygems

Version Path
p8-castronaut-0.6.1.1 vendor/rack/lib/rack/handler.rb
relevance-castronaut-0.6.0 vendor/rack/lib/rack/handler.rb
relevance-castronaut-0.6.1 vendor/rack/lib/rack/handler.rb
relevance-castronaut-0.7.4 vendor/rack/lib/rack/handler.rb
relevance-castronaut-0.7.5 vendor/rack/lib/rack/handler.rb
timocratic-rack-1.0.0 lib/rack/handler.rb
nbudin-castronaut-0.7.5 vendor/rack/lib/rack/handler.rb
webroar-0.2.2 src/admin_panel/vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler.rb
actionpack-2.3.2 lib/action_controller/vendor/rack-1.0/rack/handler.rb
mack-0.8.3.1 lib/gems/rack-0.9.1/lib/rack/handler.rb
mack-0.8.3 lib/gems/rack-0.9.1/lib/rack/handler.rb
passenger-2.1.2 vendor/rack-0.9.1/lib/rack/handler.rb
passenger-2.1.3 vendor/rack-0.9.1/lib/rack/handler.rb
passenger-2.2.0 vendor/rack-0.9.1/lib/rack/handler.rb
passenger-2.2.1 vendor/rack-0.9.1/lib/rack/handler.rb
rack-0.9.0 lib/rack/handler.rb
rack-0.9.1 lib/rack/handler.rb
radiant-0.8.0 vendor/rails/actionpack/lib/action_controller/vendor/rack-1.0/rack/handler.rb