This is a template loosely based off of ZapNaps Sinatra-Template at: github.com/zapnap/sinatra-template.
This has been tested using Ruby 1.9.3 and Couchrest_Model 1.1.2
Be sure to check through the Gemfile. I have commented out things that you may think extranious, but I use them, so they’re there.
General setup is done in environment.rb
Here, you can change the Sinatra port, and CouchDB database name and port.
application.rb
is where all the fun, Sinatra controller verbage lives.
Throw your Couch models in the model
dir.
Place your haml in views
and sass in public
.
Helpers go in the helpers
dir. Make sure the files are named *_helper.rb
Add your specs in spec
. user_spec.rb
is a sample spec ready to roll. If you create more, be sure to add
require "#{File.dirname(__FILE__)}/spec_helper"
to the top of the new spec.
To run, you can either run them manually with:
rspec spec/
bundle install ruby application.rb
© 2012 Ben Woodall. This code is distributed under the MIT license.