From 56152d8f60963a3d862f335144a33782723ade83 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 18 Jan 2009 00:18:02 +0000 Subject: Regenerate guides --- railties/doc/guides/html/rails_on_rack.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'railties/doc/guides/html/rails_on_rack.html') diff --git a/railties/doc/guides/html/rails_on_rack.html b/railties/doc/guides/html/rails_on_rack.html index 411411cb41..eb1ff6ef1b 100644 --- a/railties/doc/guides/html/rails_on_rack.html +++ b/railties/doc/guides/html/rails_on_rack.html @@ -165,7 +165,7 @@ Understand the best practices for developing a middleware aimed at Rails applica

script/server does the basic job of creating a Rack::Builder object and starting the webserver. This is Rails equivalent of Rack’s rackup script.

Here’s how script/server creates an instance of Rack::Builder

-
@@ -208,7 +208,7 @@ cellspacing="0" cellpadding="4">

2.3. rackup

To use rackup instead of Rails' script/server, you can put the following inside config.ru of your Rails application’s root directory:

-
@@ -220,14 +220,14 @@ use Rails::Rack run ActionController::Dispatcher.new

And start the server:

-
[lifo@null application]$ rackup

To find out more about different rackup options:

-
@@ -248,14 +248,14 @@ http://www.gnu.org/software/src-highlite -->

3.1. Inspecting Middleware Stack

Rails has a handy rake task for inspecting the middleware stack in use:

-
$ rake middleware

For a freshly generated Rails application, this will produce:

-
@@ -270,7 +270,7 @@ run ActionController::Dispatcher

Rails provides a very simple configuration interface for adding generic Rack middlewares to a Rails applications.

Here’s how you can add middlewares via environment.rb

-
@@ -279,7 +279,7 @@ http://www.gnu.org/software/src-highlite --> config.middleware.use Rack::BounceFavicon

3.3. Internal Middleware Stack

-
@@ -353,7 +353,7 @@ cellspacing="0" cellpadding="4">

VERIFY THIS WORKS. Just a code dump at the moment.

Put the following in an initializer.

-
@@ -380,14 +380,14 @@ or something like that

4.1. Generating a Metal Application

Rails provides a generator called performance_test for creating new performance tests:

-
script/generate metal poller

This generates poller.rb in the app/metal directory:

-
@@ -408,7 +408,7 @@ http://www.gnu.org/software/src-highlite -->

All Metal Applications are executed by Rails::Rack::Metal middleware, which is a part of the ActionController::MiddlewareStack chain.

Here’s the primary method responsible for running the Metal applications:

-
-- cgit v1.2.3