Sha256: 2e3146a2faea44ee61df0297440fd37cc863212f41b82b165a2c487b4d91870d

Contents?: true

Size: 1.76 KB

Versions: 3

Compression:

Stored size: 1.76 KB

Contents

From 5a6c869d4709ce84d7c07b5dd33cf06e39c0111e Mon Sep 17 00:00:00 2001
From: Sarah Taraporewalla <sarah.tarap@gmail.com>
Date: Mon, 16 Feb 2009 20:44:08 +0000
Subject: [PATCH 1] SarahTaraporewalla: adding new template file for slippers template engine

---
 lib/ramaze/template.rb |    2 +-
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/lib/ramaze/template.rb b/lib/ramaze/template.rb
index 096816b..99f1f94 100644
--- a/lib/ramaze/template.rb
+++ b/lib/ramaze/template.rb
@@ -18,7 +18,7 @@ module Ramaze
 
     AVAILABLE_ENGINES = %w[
       Amrita2 Builder Erubis Haml Liquid Markaby Maruku Nagoro None RedCloth
-      Remarkably Sass Tagz Tenjin XSLT
+      Remarkably Sass Slippers Tagz Tenjin XSLT
     ]
 
     AVAILABLE_ENGINES.each do |const|
-- 

diff --git a/lib/ramaze/template/slippers.rb b/lib/ramaze/template/slippers.rb
new file mode 100755
index 0000000..e9981b4
--- /dev/null
+++ b/lib/ramaze/template/slippers.rb
@@ -0,0 +1,25 @@
+require 'slippers'
+
+module Ramaze
+  module Template
+    class Slippers < Template
+
+      ENGINES[self] = %w[ st ]
+      class << self
+        def transform(action)
+          slippers = wrap_compile(action)
+          object_to_render = ::Slippers::BindingWrapper.new(action.binding)
+          slippers.render(object_to_render)
+        end
+
+        def compile(action, template)
+          subtemplates = action.controller.trait[:slippers_options] || {}
+         
+          template_group_directory = ::Slippers::TemplateGroupDirectory.new(Global.view_root)
+          template_group = ::Slippers::TemplateGroup.new(:super_group => template_group_directory, :templates => subtemplates)
+          ::Slippers::Engine.new(template, :template_group => template_group)
+        end
+      end
+    end
+  end
+end
-- 
1.6.1

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
starapor-slippers-0.0.1 lib/ramazeTemplates/0001-SarahTaraporewalla-adding-new-template-file-for-sli.patch
starapor-slippers-0.0.2 lib/ramazeTemplates/0001-SarahTaraporewalla-adding-new-template-file-for-sli.patch
starapor-slippers-0.0.3 lib/ramazeTemplates/0001-SarahTaraporewalla-adding-new-template-file-for-sli.patch