Home

Awesome

Sinatra Boilerplate

A great place to start with Sinatra, HTML5 Boilerplate, Compass, CoffeeScript and Sprockets all cooked together.

TL;DR

  1. Grab the code and bundle the gems.
  2. Make sure you have memcached installed.
  3. Run rake s to start the development server.

What's in the Box

HTML5 Boilerplate

sinatra-boilerplate uses some of the utter uber-hawtness that is the HTML5 Boilerplate but not all. I opted not to use the build script stuff because I feel like it adds an extra layer of trouble when working with Sinatra.

The base layout file is pretty compliant with what the Boilerplate puts out except for a few minor tweaks. Most of the comments have been left in place as well.

Direct implementations from HTML5BP:

Modernizr

Modernizr is fantastic and I threw it in because... well, it's fantastic!

Compass

Because CSS sucks and SASS + Compass doesn't; it gives you all kinds of great mixins and nesting stuff that would surely make anyone who's done a lot of CSS quiver in delight. Scope the docs and get crackin'.

Susy

Susy is a fantastic grid system built to be responsive and lithe. Check out the docs here and get griddin'

Sinatra Addons

Form Tag Helpers

The thing I missed most in Sinatra was the glorious input_for kind of stuff you get with Rails, so I made some! I've included them by way of the gem I made, 'sinatra-tag-helpers'.

Routing Helpers

Some simple routing helpers I end up using a lot with Sinatra. Methods like:

Extra Hawt Sauce

I've added a bunch of modules and helper functions that I use all the time to this to (hopefully) make your life easier when you're getting your app first setup. Some of the helpers methods I've added include:

Server Goodies

How to Use It

You like it? Awesome! Here's how to use it:

  1. Download it (either through git or the download button).
  2. bundle
  3. Make sure you have memcached installed and running (memcached -d).
  4. Run rake s from the directory you checked the code out to.
  5. Profit!

If you have suggestions or think I goofed please let me know or send a pull request!

Acknowledgements

All the stuff used here is either open source or donation ware and totally the work of the people who made it, not me. I just put the pieces together and bundled it up all pretty-like. This little starter package wouldn't be possible without the awesome work these guys have done and their generosity in sharing their code with the rest of us.

Oh, and...

<pre> # . . . . . . . . . . . . . . . . _,,,--~~~~~~~~--,_ # . . . . . . . . . . . . . . ,-' : : : :::: :::: :: : : : : :º '-, ITS A TRAP! # . . . . . . . . . . . . .,-' :: : : :::: :::: :::: :::: : : :o : '-, # . . . . . . . . . . . ,-' :: ::: :: : : :: :::: :::: :: : : : : :O '-, # . . . . . . . . . .,-' : :: :: :: :: :: : : : : : , : : :º :::: :::: ::'; # . . . . . . . . .,-' / / : :: :: :: :: : : :::: :::-, ;; ;; ;; ;; ;; ;; ;\ # . . . . . . . . /,-',' :: : : : : : : : : :: :: :: : '-, ;; ;; ;; ;; ;; ;;| # . . . . . . . /,',-' :: :: :: :: :: :: :: : ::_,-~~,_'-, ;; ;; ;; ;; | # . . . . . _/ :,' :/ :: :: :: : : :: :: _,-'/ : ,-';'-'''''~-, ;; ;; ;;,' # . . . ,-' / : : : : : : ,-''' : : :,--'' :|| /,-'-'--'''__,''' \ ;; ;,-'/ # . . . \ :/,, : : : _,-' --,,_ : : \ :\ ||/ /,-'-'x### ::\ \ ;;/ # . . . . \/ /---'''' : \ #\ : :\ : : \ :\ \| | : (O##º : :/ /-'' # . . . . /,'____ : :\ '-#\ : \, : :\ :\ \ \ : '-,___,-',-`-,, # . . . . ' ) : : : :''''--,,--,,,,,,¯ \ \ :: ::--,,_''-,,'''¯ :'- :'-, # . . . . .) : : : : : : ,, : ''''~~~~' \ :: :: :: :'''''¯ :: ,-' :,/\ # . . . . .\,/ /|\\| | :/ / : : : : : : : ,'-, :: :: :: :: ::,--'' :,-' \ \ # . . . . .\\'|\\ \|/ '/ / :: :_--,, : , | )'; :: :: :: :,-'' : ,-' : : :\ \, # . . . ./¯ :| \ |\ : |/\ :: ::----, :\/ :|/ :: :: ,-'' : :,-' : : : : : : ''-,, # . . ..| : : :/ ''-(, :: :: :: '''''~,,,,,'' :: ,-'' : :,-' : : : : : : : : :,-'''\\ # . ,-' : : : | : : '') : : :¯''''~-,: : ,--''' : :,-'' : : : : : : : : : ,-' :¯'''''-,_ . # ./ : : : : :'-, :: | :: :: :: _,,-''''¯ : ,--'' : : : : : : : : : : : / : : : : : : :''-, # / : : : : : -, :¯'''''''''''¯ : : _,,-~'' : : : : : : : : : : : : : :| : : : : : : : : : # : : : : : : : :¯''~~~~~~''' : : : : : : : : : : : : : : : : : : | : : : : : : : : : </pre>

So, ya know, watch out...