Sinatra integration - SynApps/trackman GitHub Wiki
This guide is intended to help you integrate trackman to Sinatra. For a high-level view of features, go read the website or the readme
Initial setup
heroku addons:add trackman
gem 'trackman'
bundle install
You will need to reference Trackman's rake tasks within your Rakefile:
require 'rubygems'
require 'bundler/setup'
Bundler.require
load "trackman/tasks/trackman.rake"
Then you can run:
rake trackman:setup
Use the middleware
To enable Trackman to sync your assets when you deploy, you need to use it's middleware.
This is how I did it on a fake app.
require 'sinatra'
class SinatraTest < Sinatra::Base
get '/' do
'Hello world!'
end
use Trackman::Middleware if environment == :production
end
The maintenance pages
As always, Trackman looks for them at
public/503.html
public/503-error.html
On Sinatra, there is the possibility that you configure your static folder path instead of using the default 'public'.
I say it right away, Trackman expects the page and assets to be inside the 'public' folder.
If you don't follow this, I can guarantee that you will suffer.
Build our pages
Links your assets within your static folder as you would in any other page. Once you're done and your pages look fine, just deploy them. Again, Trackman will sync everything to S3 and you can sleep well.