SinatraHelpers

Description

This is a ruby gem with a bunch of helpers to make Sinatra more useful.

A Generator

I’ve written a generator for new Sinatra apps. Please note: I’ve written this generator suited for my needs and paradigms in writing Sinatra apps. It is written for me and comes AS IS. Use if you wish, but know that it conforms to what I like using in Sinatra apps, including:

* Most, if not all, of the helpers in this gem
* Gem configuration (via gemsconfig: http://github.com/kelredd/gemsconfig)
* Sprockets (via sprockets-sinatra: http://github.com/kelredd/sprockets-sinatra)
* Less (coming)
* Capistrano deployment scheme
* Source control with Git
* Erb (with generators from useful: http://github.com/kelredd/useful/tree/master/lib/useful/erb_helpers/)
* an App directory structure similar to Rails'
* Default layout that I like
* Rack::Cache using my configuration (see admin/production.ru)
* Rack::Flash
* Unit testing with Test::Unit (coming)
* BDD using Cucumber (coming)

If you don’t like/want to use something that this generates, don’t use the generator, or back out some generated code manually. Ok, enough about that. On to usage:

$ sinatra path/to/app
# will create the app structure in path/to/app

Environment Tests

Have environment tests like development? and production? available in your app code

Erb Helpers

Helpful view template helpers for partial rendering and html generation. See github.com/kelredd/useful/tree/master/lib/useful/erb_helpers/ for more info.

Sprockets

Coming.

ActiveRecord

Coming.

Installation

sudo gem install kelredd-sinatra-helpers --source http://gemcutter.org

Usage

require 'sinatra_helpers'

License

Copyright © 2009 Kelly Redding

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.