Sha256: 844b8e07d9c4a5f7365c133eb54f0ef3242cea2938f132bbb866f62587ad1eba

Contents?: true

Size: 542 Bytes

Versions: 14

Compression:

Stored size: 542 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'webgen/content_processor'
require 'erb'

module Webgen
  class ContentProcessor

    # Processes embedded Ruby statements.
    module Erb

      extend ERB::Util

      # Process the Ruby statements embedded in the content of +context+.
      def self.call(context)
        erb = ERB.new(context.content, nil, context.website.config['content_processor.erb.trim_mode'])
        erb.filename = context.ref_node.alcn
        context.content = erb.result(binding)
        context
      end

    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
webgen-1.7.0 lib/webgen/content_processor/erb.rb
webgen-1.6.0 lib/webgen/content_processor/erb.rb
webgen-1.5.2 lib/webgen/content_processor/erb.rb
webgen-1.5.1 lib/webgen/content_processor/erb.rb
webgen-1.5.0 lib/webgen/content_processor/erb.rb
webgen-1.4.1 lib/webgen/content_processor/erb.rb
webgen-1.4.0 lib/webgen/content_processor/erb.rb
webgen-1.3.0 lib/webgen/content_processor/erb.rb
webgen-1.2.1 lib/webgen/content_processor/erb.rb
webgen-1.2.0 lib/webgen/content_processor/erb.rb
webgen-1.1.0 lib/webgen/content_processor/erb.rb
webgen-1.0.0 lib/webgen/content_processor/erb.rb
webgen-1.0.0.beta3 lib/webgen/content_processor/erb.rb
webgen-1.0.0.beta2 lib/webgen/content_processor/erb.rb