Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created March 26, 2010 22:37
Show Gist options
  • Save defunkt/345490 to your computer and use it in GitHub Desktop.
Save defunkt/345490 to your computer and use it in GitHub Desktop.
Upgrading to Sinatra 1.0 and Mustache 0.9

Previously you'd do this:

set :namespace, Haystack
set :views, 'templates/'
set :mustaches, views/'

Now you do this:

set :mustache, {
  :namespace => Haystack,
  :templates => 'templates/',
  :views     => 'views/'
}
diff --git a/lib/haystack/app.rb b/lib/haystack/app.rb
index a4087e1..6c0ee1b 100644
--- a/lib/haystack/app.rb
+++ b/lib/haystack/app.rb
@@ -10,14 +10,16 @@ module Haystack
set :public, "#{dir}/public"
set :static, false
- # Tell mustache where the Views constant lives
- set :namespace, Haystack
+ set :mustache, {
+ # Tell mustache where the Views constant lives
+ :namespace => Haystack,
- # Mustache templates live here
- set :views, "#{dir}/templates"
+ # Mustache templates live here
+ :templates => "#{dir}/templates",
- # Tell mustache where the views are
- set :mustaches, "#{dir}/views"
+ # Tell mustache where the views are
+ :views => "#{dir}/views"
+ }
# Sinatra error handling
configure :development, :staging do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment