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

Version Path
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/tilt-2.0.7/lib/tilt/erubi.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/erubi.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/erubi.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/erubi.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/erubi.rb
brakeman-3.7.1 bundle/ruby/2.3.0/gems/tilt-2.0.8/lib/tilt/erubi.rb
tilt-2.0.8 lib/tilt/erubi.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/tilt-2.0.7/lib/tilt/erubi.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/tilt-2.0.7/lib/tilt/erubi.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/tilt-2.0.7/lib/tilt/erubi.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/tilt-2.0.7/lib/tilt/erubi.rb
brakeman-3.7.0 bundle/ruby/2.3.0/gems/tilt-2.0.7/lib/tilt/erubi.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/tilt-2.0.7/lib/tilt/erubi.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/tilt-2.0.7/lib/tilt/erubi.rb
brakeman-3.6.2 bundle/ruby/2.3.0/gems/tilt-2.0.7/lib/tilt/erubi.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/tilt-2.0.7/lib/tilt/erubi.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/tilt-2.0.7/lib/tilt/erubi.rb
brakeman-3.6.1 bundle/ruby/2.3.0/gems/tilt-2.0.7/lib/tilt/erubi.rb
brakeman-3.6.0 bundle/ruby/2.3.0/gems/tilt-2.0.7/lib/tilt/erubi.rb
tilt-2.0.7 lib/tilt/erubi.rb