A base Sinatra application template. Just fork and build. Yay! Includes MongoMapper, whenever and runner with RSpec, and Haml
Dependencies and all configuration is done in environment.rb
. Your database is also set up here. MongoMapper will use localhost by default. We also delete all app collections after each test run.
Add your controller actions in application.rb
. Views for these actions are placed in the views
directory. Static files, including a stock stylesheet, go in the public
directory. Models go in the lib
directory and are auto-loaded.
If you need to run periodic scripts, add them to schedule.rb using whenever. These will be run via cron. Crontabs are updated upon deploy. See Capfile for details.
Add your specs in spec
; just require spec_helper.rb
to pre-configure the test environment. A number of samples are provided (including a sample model, which can be removed). To run the specs:
rake spec
ruby application.rb