lib/mattock/template-host.rb in mattock-0.2.10 vs lib/mattock/template-host.rb in mattock-0.2.11

- old
+ new

@@ -39,13 +39,17 @@ @template_cache ||= Tilt::Cache.new end attr_accessor :valise + def find_template(path) + valise.find(["templates"] + valise.unpath(path)).contents + end + def render(path, locals=nil) template = TemplateHost::template_cache.fetch(path) do Tilt.new(path) do |tmpl| - valise.find(["templates"] + valise.unpath(tmpl.file)).contents + find_template(tmpl.file) end end template.render(self, locals) end