Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Added Rack framework support #186

Closed
wants to merge 2 commits into from

Conversation

krobertson
Copy link
Contributor

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

@oza
Copy link

oza commented Feb 22, 2012

+1

Great work! Rack support is essential to extend the range of application of CloudFoundry!
I'll try this patch later in my local CF environment.

@wallyqs
Copy link

wallyqs commented Feb 24, 2012

+1
I was also looking for something like this. It seems that the Cloudfoundry team is also working on this (http://support.cloudfoundry.com/entries/20124338-rack-support), but Rack support without using workarounds is very important, so until things are solved this patch will be very useful. Thanks for sharing!

@krobertson
Copy link
Contributor Author

I had seen that thread before, but hadn't seen the most recent updates. Adding support for non-web processes like Resque workers would be awesome, but adding Rack support was pretty easy for CF as it is now. This rack support is already live on PaaS.io.

@wallyqs
Copy link

wallyqs commented Feb 24, 2012

I agree, so having the community adding this was going happen sooner or later. It is great that you are already using it on production.

@ramnivas
Copy link
Contributor

Processed. 0f1cdf5

@ramnivas ramnivas closed this Mar 23, 2012
@oza
Copy link

oza commented Mar 23, 2012

Congrats!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants