lib/ejs.rb
# Evaluates an EJS template with the given local variables and
# compiler options. You will need the ExecJS
# (https://github.com/sstephenson/execjs/) library and a
# JavaScript runtime available.
#
#     EJS.evaluate("Hello <%= name %>", :name => "world")
#     # => "Hello world"
#
Evaluates an EJS template with the given local variables and
compiler options. You will need the ExecJS
library and a
JavaScript runtime available.


Evaluates an EJS template with the given local variables and compiler options . You will need the ExecJS library and a JavaScript runtime available .
def evaluate(template, locals = {}, options = {})
      require "execjs"
      context = ExecJS.compile("var evaluate = #{compile(template, options)}")
      context.call("evaluate", locals)
    end
def evaluate ( template , locals = { } , options = { } ) require "execjs" context = ExecJS . compile ( "var evaluate = #{compile(template, options)}" ) context . call ( "evaluate" , locals ) end
Evaluates an EJS template with the given local variables and
compiler options.
Evaluates an EJS template with the given local variables and compiler options .
template
<not_specific>
locals
<not_specific>
options
<not_specific>