Sha256: 4cbb003a4faeaeb754e2e636eb2a20f2931107789a931e22e43f7bc319851465

Contents?: true

Size: 362 Bytes

Versions: 10

Compression:

Stored size: 362 Bytes

Contents

# encoding: utf-8

module Nanoc3::Filters
  class ERB < Nanoc3::Filter

    def run(content, params={})
      require 'erb'

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

      # Get result
      erb = ::ERB.new(content)
      erb.filename = filename
      erb.result(context.get_binding { assigns[:content] })
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nanoc3-3.0.9 lib/nanoc3/filters/erb.rb
nanoc3-3.0.8 lib/nanoc3/filters/erb.rb
nanoc3-3.0.7 lib/nanoc3/filters/erb.rb
nanoc3-3.0.6 lib/nanoc3/filters/erb.rb
nanoc3-3.0.5 lib/nanoc3/filters/erb.rb
nanoc3-3.0.4 lib/nanoc3/filters/erb.rb
nanoc3-3.0.3 lib/nanoc3/filters/erb.rb
nanoc3-3.0.2 lib/nanoc3/filters/erb.rb
nanoc3-3.0.1 lib/nanoc3/filters/erb.rb
nanoc3-3.0.0 lib/nanoc3/filters/erb.rb