Sha256: 393e0c91294a4b74a4f87a40a5f66287889454b44d5737aa3e55ce4bd1e41823
Contents?: true
Size: 781 Bytes
Versions: 30
Compression:
Stored size: 781 Bytes
Contents
require 'ruhl' module Sinatra module Templates def ruhl(template, options = {}, locals = {}) require_warn('Ruhl') unless defined?(::Ruhl::Engine) render :ruhl, template, options, locals end private def render(engine, template, options={}, locals={}) # merge app-level options options = self.class.send(engine).merge(options) if self.class.respond_to?(engine) views = options.delete(:views) || self.class.views || "./views" # render template data, options[:filename], options[:line] = lookup_template(engine, template, views) __send__("render_#{engine}", template, data, options) end def render_ruhl(template, data, options) ::Ruhl::Engine.new(data, options).render(self) end end end
Version data entries
30 entries across 30 versions & 1 rubygems