This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: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
orthin
(thin will imply rack).I've also documented a quick "Getting Started" app here: http://dev.paas.io/tutorials/ruby-rack