Class: Merb::Template::Erubis

Inherits:
Object
  • Object
show all
Defined in:
lib/merb-core/controller/template.rb

Defined Under Namespace

Modules: Mixin

Class Method Summary collapse

Class Method Details

.compile_template(io, name, mod) ⇒ Object

Parameters

io<#path>

An IO containing the full path of the template.

name<String>

The name of the method that will be created.

mod<Module>

The module that the compiled method will be placed into.



160
161
162
163
164
165
166
167
168
# File 'lib/merb-core/controller/template.rb', line 160

def self.compile_template(io, name, mod)
  template = ::Erubis::BlockAwareEruby.new(io.read)

  _old_verbose, $VERBOSE = $VERBOSE, nil
  template.def_method(mod, name, File.expand_path(io.path))
  $VERBOSE = _old_verbose
  
  name
end