Module: Webgen::ContentProcessor::Erubis

Extended by:
Erubis::XmlHelper
Includes:
Erubis
Defined in:
lib/webgen/content_processor/erubis.rb

Overview

Processes embedded Ruby statements with the erubis library.

Defined Under Namespace

Classes: CompatibleEruby, CompatiblePIEruby

Class Method Summary collapse

Class Method Details

.call(context) ⇒ Object

Process the Ruby statements embedded in the content of context.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/webgen/content_processor/erubis.rb', line 27

def self.call(context)
  options = context.website.config['content_processor.erubis.options']
  erubis = if context.website.config['content_processor.erubis.use_pi']
             CompatiblePIEruby.new(context.content, options)
           else
             CompatibleEruby.new(context.content, options)
           end
  erubis.filename = context.ref_node.alcn
  context.content = erubis.result(binding)
  context
end