Skip to content

Commit

Permalink
Evaluate config file in Sinatra context. Set template engine explicitly.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmycuadra committed May 27, 2012
1 parent bc6872e commit 9294dde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions assets/template/deck.rb
@@ -1,5 +1,7 @@
# Require template language, CSS preprocessor, and JS preprocessor gems here

# Require and set your preferred template engine
require "haml"
set :template_engine, :haml

# Require any CSS and JS preprocessors you want to use
require "sass"
require "coffee-script"
7 changes: 5 additions & 2 deletions lib/penguin/application.rb
@@ -1,5 +1,4 @@
require "sinatra/base"
require File.expand_path("deck", Dir.pwd)

module Penguin
class Application < Sinatra::Base
Expand All @@ -8,14 +7,18 @@ class Application < Sinatra::Base
set :views, root
set :static, true

configure do
eval File.read(File.expand_path("deck.rb", root))
end

use Sprockets do |env|
env.append_path root
env.append_path File.expand_path("../../../assets/css", __FILE__)
env.append_path File.expand_path("../../../assets/js", __FILE__)
end

get "/" do
haml :deck
send(settings.template_engine, :deck)
end
end
end

0 comments on commit 9294dde

Please sign in to comment.