Class

Dispatcher

Extends:

This class provides an interface for dispatching a CGI (or CGI-like) request to the appropriate controller and action. It also takes care of resetting the environment (when Dependencies.load? is true) after each request.

Aliases
preparation_callbacks_run?
Private Attributes
preparation_callbacks
preparation_callbacks_run
Public Methods
dispatch Dispatch the given CGI request, using the given session options, and emitting the output via the given output. If you dispatch with your own CGI object be sure to handle the exceptions it raises on multipart requests (EOFError and ArgumentError).
reset_application! Reset the application by clearing out loaded controllers, views, actions, mailers, and so forth. This allows them to be loaded again without having to restart the server (WEBrick, FastCGI, etc.).
to_prepare Add a preparation callback. Preparation callbacks are run before every request in development mode, and before the first request in production mode.
Private Methods
failsafe_response If the block raises, send status code as a last-ditch response.
new_cgi CGI.new plus exception handling. CGI#read_multipart raises EOFError if body.empty? or body.size != Content-Length and raises ArgumentError if Content-Length is non-integer.
prepare_application
prepare_breakpoint
reset_after_dispatch
run_preparation_callbacks
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.