Sha256: 5f5ed5112a04948d967a203c81cfc12afc49242f4e12c14ecbd6361bfb7f0e8a

Contents?: true

Size: 568 Bytes

Versions: 12

Compression:

Stored size: 568 Bytes

Contents

# encoding: utf-8

module Nanoc3::Filters
  class Erubis < Nanoc3::Filter

    # Runs the content through [Erubis](http://www.kuwata-lab.com/erubis/).
    # This method takes no options.
    #
    # @param [String] content The content to filter
    #
    # @return [String] The filtered content
    def run(content, params={})
      require 'erubis'

      # Create context
      context = ::Nanoc3::Context.new(assigns)

      # Get result
      ::Erubis::Eruby.new(content, :filename => filename).result(context.get_binding { assigns[:content] })
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
nanoc3-3.1.6 lib/nanoc3/filters/erubis.rb
nanoc3-3.2.0a3 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.5 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.4 lib/nanoc3/filters/erubis.rb
nanoc3-3.2.0a2 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.3 lib/nanoc3/filters/erubis.rb
nanoc3-3.2.0a1 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.2 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.1 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.0 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.0rc1 lib/nanoc3/filters/erubis.rb
nanoc3-3.1.0b2 lib/nanoc3/filters/erubis.rb