module EJS
def compile(source, options = {})
# => "function(obj){...}"
EJS.compile("Hello <%= name %>")
template.
`compile` if you want to specify a different tag syntax for the
`:evaluation_pattern` and `:interpolation_pattern` options to
variables in the template. You can optionally pass the
function takes an optional argument, an object specifying local
Compiles an EJS template to a JavaScript function. The compiled
def compile(source, options = {}) source = source.dup js_escape!(source) replace_escape_tags!(source, options) replace_interpolation_tags!(source, options) replace_evaluation_tags!(source, options) "function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments);};" + "with(obj||{}){__p.push('#{source}');}return __p.join('');}" end