--0015175caebec379a704baec4576
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

One of the great advancements of Rails 3 brought to the table was enough
modularity to let you build custom Rails stacks tuned to specific
needs. Out of the box Rails is tuned to be as inclusive as possible,
bringing you as many features as it possibly can. It's modular enough you
can remove what you want if you don't need it, but by default ships with
everything on.

This inclusiveness lead to a backlash of minimalist frameworks, most
notably Sinatra. Sinatra tried to provide as little as possible while still
being useful, and at the same time removed much of the Rails ceremony from
the DSL it used for rendering responses.

Thanks to Rails 3, the framework is now modular enough you can boot a
barebones version of it from a single file:

https://gist.github.com/1942658

Lightrail ships a Rails 3 barebones stack, but with some added niceties for
apps that provide JSON APIs:

https://github.com/lightness/lightrail

It's minimalist Rails 3 with enough Sinatraisms baked in I hope it can win
over some of those people who think Rails is too bloated and use Sinatra
instead. That's not to say Sinatra is bad, but I have seen apps built on
Sintra which have outgrown it, and for them, I think a Rails-based stack
would be a better choice.

For those of you who hated Rails 3's stack traces, Lightrail ships with
minimal middleware and is tuned to eliminate many of the frustrations which
give the impression Rails is a big bloated framework.

Lightrail is originally derived from the Rails 3 stack used for
applications with client-heavy SproutCore front-ends at Strobe (
http://strobecorp.com). Its principal authors are JosValim and Carl
Lerche.

--

Install the lightrail gem:

gem install lightrail

Like Rails, installing the lightrail gem will install a command line
utility called 'lightrail'. This command is in fact identical to the
'rails' command, but tweaked for Lightrail defaults instead of Rails
defaults.

You can use 'lightrail' to create a new application skeleton just like
Rails:

lightrail new myapp

The skeleton application that Lightrail generates is identical to a
standard Rails application, with only these changes:

   - Gemfile pulls in lightrail instead of rails
   - application.rb pulls in lightrail instead of rails
   - ApplicationController descends from Lightrail::ActionController::Metal
   instead of ActionController::Base. ActionView is not used or installed.

Once you've created your application, run:

lightrail server

to launch a web server in the development environment (just like Rails!)

You can convert an existing Rails 3 application to a Lightrail application
by retrofitting the changes mentioned above.
-- 
Tony Arcieri

--0015175caebec379a704baec4576
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

One of the great advancements of Rails 3 brought to the table was enough modularity to let you build custom Rails stacks tuned to specific needs.                       
<br></div><div>This inclusiveness lead to a backlash of minimalist frameworks, most notably Sinatra. Sinatra tried to provide as little as possible while still being useful, and at the same time removed much of the Rails ceremony from the DSL it used for rendering responses.</div>

<div><br></div><div>Thanks to Rails 3, the framework is now modular enough you can boot a barebones version of it from a single file:</div><div><br></div><div>https://gist.github.com/1942658</div>

<div><br></div><div>Lightrail ships a Rails 3 barebones stack, but with some added niceties for apps that provide JSON APIs:</div><div><br></div><div>https://github.com/lightness/lightrail</div>

<div><br></div><div>It&#39;s minimalist Rails 3 with enough Sinatraisms baked in I hope it can win over some of those people who think Rails is too bloated and use Sinatra instead. That&#39;s not to say Sinatra is bad, but I have seen apps built on Sintra which have outgrown it, and for them, I think a Rails-based stack would be a better choice.</div>

<div><br></div><div>For those of you who hated Rails 3&#39;s stack traces, Lightrail ships with minimal middleware and is tuned to eliminate many of the frustrations which give the impression Rails is a big bloated framework.</div>

<div><br></div><div>Lightrail is originally derived from the Rails 3 stack used for applications with client-heavy SproutCore front-ends at Strobe (<aref="http://strobecorp.com">http://strobecorp.com</a>). Its principal authors are   宼
<br>--</div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

Install the lightrail gem:</p><p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

<code style="margin-top:0px;margin-right:2px;margin-bottom:0px;margin-left:2px;padding-top:0px;padding-right:5px;padding-bottom:0px;padding-left:5px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-style:initial;border-color:initial;font:inherit;font-family:&#39;Bitstream Vera Sans Mono&#39;,Courier,monospace;line-height:normal;white-space:nowrap;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(234,234,234);border-right-color:rgb(234,234,234);border-bottom-color:rgb(234,234,234);border-left-color:rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">gem install lightrail</code></p>

<p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

Like Rails, installing the lightrail gem will install a command line utility called &#39;lightrail&#39;. This command is in fact identical to the &#39;rails&#39; command, but tweaked for Lightrail defaults instead of Rails defaults.</p>

<p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

You can use &#39;lightrail&#39; to create a new application skeleton just like Rails:</p><p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

<code style="margin-top:0px;margin-right:2px;margin-bottom:0px;margin-left:2px;padding-top:0px;padding-right:5px;padding-bottom:0px;padding-left:5px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-style:initial;border-color:initial;font:inherit;font-family:&#39;Bitstream Vera Sans Mono&#39;,Courier,monospace;line-height:normal;white-space:nowrap;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(234,234,234);border-right-color:rgb(234,234,234);border-bottom-color:rgb(234,234,234);border-left-color:rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">lightrail new myapp</code></p>

<p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

The skeleton application that Lightrail generates is identical to a standard Rails application, with only these changes:</p><ul style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:30px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

<li style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;font:inherit">

Gemfile pulls in lightrail instead of rails</li><li style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;font:inherit">

application.rb pulls in lightrail instead of rails</li><li style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;font:inherit">

ApplicationController descends from Lightrail::ActionController::Metal instead of ActionController::Base. ActionView is not used or installed.</li></ul><p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

Once you&#39;ve created your application, run:</p><p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

<code style="margin-top:0px;margin-right:2px;margin-bottom:0px;margin-left:2px;padding-top:0px;padding-right:5px;padding-bottom:0px;padding-left:5px;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-style:initial;border-color:initial;font:inherit;font-family:&#39;Bitstream Vera Sans Mono&#39;,Courier,monospace;line-height:normal;white-space:nowrap;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(234,234,234);border-right-color:rgb(234,234,234);border-bottom-color:rgb(234,234,234);border-left-color:rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">lightrail server</code></p>

<p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

to launch a web server in the development environment (just like Rails!)</p><p style="margin-top:15px;margin-right:0px;margin-bottom:15px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font:inherit;color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;line-height:22px;background-color:rgb(255,255,255)">

You can convert an existing Rails 3 application to a Lightrail application by retrofitting the changes mentioned above.</p>-- <br>Tony Arcieri<br><br>
</div>

--0015175caebec379a704baec4576--