Class: Tilt::ErubisTemplate

### Home Classes Methods

### In Files

- lib/tilt/erb.rb

### Parent

Tilt::ERBTemplate

### Methods

- ::engine_initialized?
- #initialize_engine
- #precompiled
- #precompiled_postamble
- #precompiled_preamble
- #prepare

### Class/Module Index

Quicksearch

- Tilt
- Tilt::AsciidoctorTemplate
- Tilt::BlueClothTemplate
- Tilt::BuilderTemplate
- Tilt::CSVTemplate
- Tilt::Cache
- Tilt::CoffeeScriptTemplate
- Tilt::CompileSite
- Tilt::CreoleTemplate
- Tilt::ERBTemplate
- Tilt::ErubisTemplate
- Tilt::EtanniTemplate
- Tilt::HamlTemplate
- Tilt::KramdownTemplate
- Tilt::LessTemplate
- Tilt::LiquidTemplate
- Tilt::MarkabyTemplate
- Tilt::MarukuTemplate
- Tilt::NokogiriTemplate
- Tilt::PlainTemplate
- Tilt::RDiscountTemplate
- Tilt::RDocTemplate
- Tilt::RadiusTemplate
- Tilt::RedClothTemplate
- Tilt::RedcarpetTemplate
- Tilt::RedcarpetTemplate::Redcarpet1
- Tilt::RedcarpetTemplate::Redcarpet2
- Tilt::SassTemplate
- Tilt::ScssTemplate
- Tilt::StringTemplate
- Tilt::Template
- Tilt::WikiClothTemplate
- Tilt::YajlTemplate

No matching classes.

# Tilt::ErubisTemplate

Erubis template implementation. See: www.kuwata-lab.com/erubis/

ErubisTemplate supports the following additional options, which are not passed down to the Erubis engine:

    :engine_class   allows you to specify a custom engine class to use
                    instead of the default (which is ::Erubis::Eruby).

    :escape_html    when true, ::Erubis::EscapedEruby will be used as
                    the engine class instead of the default. All content
                    within <%= %> blocks will be automatically html escaped.

### Public Class Methods

engine_initialized?() click to toggle source

    # File lib/tilt/erb.rb, line 76
    def self.engine_initialized?
      defined? ::Erubis::Eruby
    end

### Public Instance Methods

initialize_engine() click to toggle source

    # File lib/tilt/erb.rb, line 80
    def initialize_engine
      require_template_library 'erubis'
    end

precompiled(locals) click to toggle source

    # File lib/tilt/erb.rb, line 103
    def precompiled(locals)
      source, offset = super
      [source, offset - 1]
    end

precompiled_postamble(locals) click to toggle source

    # File lib/tilt/erb.rb, line 96
    def precompiled_postamble(locals)
      [@outvar, super].join("\n")
    end

precompiled_preamble(locals) click to toggle source

    # File lib/tilt/erb.rb, line 92
    def precompiled_preamble(locals)
      [super, "#{@outvar} = _buf = ''"].join("\n")
    end

prepare() click to toggle source

    # File lib/tilt/erb.rb, line 84
    def prepare
      @outvar = options.delete(:outvar) || self.class.default_output_variable
      @options.merge!(:preamble => false, :postamble => false, :bufvar => @outvar)
      engine_class = options.delete(:engine_class)
      engine_class = ::Erubis::EscapedEruby if options.delete(:escape_html)
      @engine = (engine_class || ::Erubis::Eruby).new(data, options)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.