Sha256: 7f437f6f4d7952f5ce4c667a91398cd8da872e2726ae4f2ccdd4bbb49b7f3680
Contents?: true
Size: 886 Bytes
Versions: 165
Compression:
Stored size: 886 Bytes
Contents
require 'tilt/template' require 'erubi' module Tilt # Erubi (a simplified version of Erubis) template implementation. # See https://github.com/jeremyevans/erubi # # ErubiTemplate supports the following additional options, in addition # to the options supported by the Erubi engine: # # :engine_class :: allows you to specify a custom engine class to use # instead of the default (which is ::Erubi::Engine). class ErubiTemplate < Template def prepare @options.merge!(:preamble => false, :postamble => false, :ensure=>true) engine_class = @options[:engine_class] || Erubi::Engine @engine = engine_class.new(data, @options) @outvar = @engine.bufvar # Remove dup after tilt supports frozen source. @src = @engine.src.dup @engine end def precompiled_template(locals) @src end end end
Version data entries
165 entries across 126 versions & 20 rubygems