Parent

Sprockets::EjsTemplate

Tilt engine class for the EJS compiler. Depends on the `ejs` gem.

For more infomation see:

  https://github.com/sstephenson/ruby-ejs

Public Class Methods

engine_initialized?() click to toggle source

Check to see if EJS is loaded

    # File lib/sprockets/ejs_template.rb, line 12
12:     def self.engine_initialized?
13:       defined? ::EJS
14:     end

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source

Compile template data with EJS compiler.

Returns a JS function definition String. The result should be assigned to a JS variable.

    # => "function(obj){...}"
    # File lib/sprockets/ejs_template.rb, line 33
33:     def evaluate(scope, locals, &block)
34:       EJS.compile(data)
35:     end
initialize_engine() click to toggle source

Autoload ejs library. If the library isn’t loaded, Tilt will produce a thread safetly warning. If you intend to use `.ejs` files, you should explicitly require it.

    # File lib/sprockets/ejs_template.rb, line 19
19:     def initialize_engine
20:       require_template_library 'ejs'
21:     end
prepare() click to toggle source
    # File lib/sprockets/ejs_template.rb, line 23
23:     def prepare
24:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.