cloudfoundry/vcap — pull request #186 by krobertson (2012-02-20 16:19:09+00:00)
Title: Added Rack framework support

I've added support for rack as a framework for ruby applications.

Rack is useful to have direct support for as simple Sinatra applications can often use other rack mixins, or there are rack-based applications like rack-jekyll or octopress.

Another problem overall with the Sinatra framework is its dependence on a `require 'sinatra'` in the application. If you have bundler load Sinatra though, it won't detect it:

require 'bundler'
Bundler.require

The detection of the Rack framework is triggered if there is a 'config.ru' file in the root directory. I've also changed the Sinatra manifest to specify there shouldn't be a config.ru. That way, if you have a config.ru, it shouldn't match as a Sinatra application.

The application is started using the simple `rackup` command. If thin is included, rack will start with thin, however if it isn't present it will fall back on webrick.

To properly use the rack support, your Gemfile needs to include either `rack` or `thin` (thin will imply rack).

I've also documented a quick "Getting Started" app here: http://dev.paas.io/tutorials/ruby-rack