Sha256: 22d6349d8e2c88886b0babd408e91f0260a353732a5b6d69f10e9e1146e4a40e

Contents?: true

Size: 648 Bytes

Versions: 18

Compression:

Stored size: 648 Bytes

Contents

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

require 'webgen/content_processor'
webgen_require 'builder'

module Webgen
  class ContentProcessor

    # Processes content that is valid Ruby to build an XML tree. This is done by using the +builder+
    # library.
    module Builder

      # Process the content of +context+ which needs to be valid Ruby code. The special variable +xml+
      # should be used to construct the XML content.
      def self.call(context)
        xml = ::Builder::XmlMarkup.new(:indent => 2)
        eval(context.content, binding, context.ref_node.alcn)
        context.content = xml.target!
        context
      end

    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
webgen-1.7.3 lib/webgen/content_processor/builder.rb
webgen-1.7.2 lib/webgen/content_processor/builder.rb
webgen-1.7.1 lib/webgen/content_processor/builder.rb
webgen-1.7.0 lib/webgen/content_processor/builder.rb
webgen-1.6.0 lib/webgen/content_processor/builder.rb
webgen-1.5.2 lib/webgen/content_processor/builder.rb
webgen-1.5.1 lib/webgen/content_processor/builder.rb
webgen-1.5.0 lib/webgen/content_processor/builder.rb
webgen-1.4.1 lib/webgen/content_processor/builder.rb
webgen-1.4.0 lib/webgen/content_processor/builder.rb
webgen-1.3.0 lib/webgen/content_processor/builder.rb
webgen-1.2.1 lib/webgen/content_processor/builder.rb
webgen-1.2.0 lib/webgen/content_processor/builder.rb
webgen-1.1.0 lib/webgen/content_processor/builder.rb
webgen-1.0.0 lib/webgen/content_processor/builder.rb
webgen-1.0.0.beta3 lib/webgen/content_processor/builder.rb
webgen-1.0.0.beta2 lib/webgen/content_processor/builder.rb
webgen-1.0.0.beta1 lib/webgen/content_processor/builder.rb