template_for(file, page = true, klass = ERB)
public
Retrieves a cache template for file, if
present, or fills the cache.
# File lib/rdoc/generator/darkfish.rb, line 735
def template_for file, page = true, klass = ERB
template = @template_cache[file]
return template if template
if page then
template = assemble_template file
erbout = 'io'
else
template = file.read
template = template.encode @options.encoding if
Object.const_defined? :Encoding
file_var = File.basename(file).sub(/\..*/, '')
erbout = "_erbout_#{file_var}"
end
template = klass.new template, nil, '<>', erbout
@template_cache[file] = template
template
end