Parent

Methods

Class/Module Index [+]

Quicksearch

Webgen::ContentProcessor::Erb

Processes embedded Ruby statements.

Public Instance Methods

call(context) click to toggle source

Process the Ruby statements embedded in the content of context.

# File lib/webgen/contentprocessor/erb.rb, line 10
def call(context)
  require 'erb'
  extend(ERB::Util)

  erb = ERB.new(context.content)
  erb.filename = context.ref_node.alcn
  context.content = erb.result(binding)
  context
rescue Exception => e
  raise Webgen::RenderError.new(e, self.class.name, context.dest_node,
                                Webgen::Common.error_file(e), Webgen::Common.error_line(e))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.