Sha256: bd2860e95c2c93a8ae6a153a0f38901e7ca7ea505335ba0a4090db5753cafd53
Contents?: true
Size: 640 Bytes
Versions: 2
Compression:
Stored size: 640 Bytes
Contents
# -*- encoding: utf-8 -*- module Webgen::ContentProcessor # Processes embedded Ruby statements. class Erb # Process the Ruby statements embedded in the content of +context+. def call(context) require 'erb' node = context.content_node ref_node = context.ref_node dest_node = context.dest_node erb = ERB.new(context.content) erb.filename = context.ref_node.absolute_lcn context.content = erb.result(binding) context rescue Exception => e raise RuntimeError, "Erb processing failed in <#{context.ref_node.absolute_lcn}>: #{e.message}", e.backtrace end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
gettalong-webgen-0.5.7.20090227 | lib/webgen/contentprocessor/erb.rb |
webgen-0.5.7 | lib/webgen/contentprocessor/erb.rb |