From 09f4eac1bf872e9b56ff6cd75ef1dd6876f7d681 Mon Sep 17 00:00:00 2001 From: Blake Mizerany Date: Mon, 1 Oct 2007 18:11:21 -0700 Subject: [PATCH] layouts in dsl --- lib/sinatra/dsl.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/sinatra/dsl.rb b/lib/sinatra/dsl.rb index 07b7063..cdc29c5 100644 --- a/lib/sinatra/dsl.rb +++ b/lib/sinatra/dsl.rb @@ -28,4 +28,12 @@ module Kernel end_eval end + def layout(name = :layout, options = {}) + Layouts[name] = unless block_given? + File.read("%s/%s" % [options[:views_directory] || 'views', name]) + else + yield + end + end + end -- 2.11.4.GIT