Skip to content

Instantly share code, notes, and snippets.

@nwest
Created April 21, 2012 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nwest/2437344 to your computer and use it in GitHub Desktop.
Save nwest/2437344 to your computer and use it in GitHub Desktop.
Sinatra Boiler
#config.ru
require 'bundler/setup'
Bundler.require :default, :"#{ENV['RACK_ENV']}"
require './app.rb'
run Sinatra::Application
#app.rb
configure do
disable :run
set :haml, {:format => :html5}
enable :sessions
end
#routing, etc
#Gemfile
source :rubygems
gem 'sinatra'
gem 'haml'
gem 'sass' #etc
##Dan's way
#config.ru
require 'bundler/setup'
Bundler.require :default, :"#{ENV['RACK_ENV']}"
require './app.rb'
run App
#app.rb
class App < Sinatra::Application
configure do
disable :run
enable :sessions
end
#everything inside this class
end
#Gemfile is the same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment