Created
July 16, 2010 09:43
-
-
Save thechrisoshow/478190 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
set :public, "/Users/chris/work/cadburysvs/v2" | |
set :bundle_path, "/Users/chris/work/cadburysvs/v2/howtoplay/bundle/" | |
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb | |
# and made a lot more robust by me | |
# this implementation uses erb by default. if you want to use any other template mechanism | |
# then replace `erb` on line 13 and line 17 with `haml` or whatever | |
module Sinatra::Partials | |
def partial(template, *args) | |
file_path = options.bundle_path + template | |
File.open(file_path,'r') do |f| | |
f.read | |
end | |
end | |
end | |
helpers Sinatra::Partials | |
get '/' do | |
erb :application | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment