Parent

Class Index [+]

Quicksearch

Merb::Template::Erubis

Constants

XmlHelper

Fixing bug in Erubis rubyforge.org/tracker/index.php?func=detail&aid=21825&group_id=1320&atid=5201

Public Class Methods

compile_template(io, name, locals, mod) click to toggle source

Parameters

io<#>

An IO containing the full path of the template.

name

The name of the method that will be created.

locals

A list of locals to assign from the args passed into the compiled template.

mod

The module that the compiled method will be placed into.

:api: private

     # File lib/merb-core/controller/template.rb, line 201
201:     def self.compile_template(io, name, locals, mod)
202:       template = ::Erubis::BlockAwareEruby.new(io.read)
203:       _old_verbose, $VERBOSE = $VERBOSE, nil
204:       assigns = locals.inject([]) do |assigns, local|
205:         assigns << "#{local} = _locals[#{local.inspect}]"
206:       end.join(";")
207:       
208:       code = "def #{name}(_locals={}); #{assigns}; #{template.src}; end"
209:       mod.module_eval code, File.expand_path(io.path)
210:       $VERBOSE = _old_verbose
211:       
212:       name
213:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.