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
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/brakeman-4.7.0/bundle/ruby/2.6.0/gems/tilt-2.0.10/lib/tilt/erubi.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
brakeman-4.7.0 bundle/ruby/2.6.0/gems/tilt-2.0.10/lib/tilt/erubi.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/tilt-2.0.10/lib/tilt/erubi.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
tilt-2.0.10 lib/tilt/erubi.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/erubi.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/tilt-2.0.9/lib/tilt/erubi.rb