Sha256: 12a5499d48a8cb1d33ebf4e766765132b69b2ee113acfec63814123401235650
Contents?: true
Size: 598 Bytes
Versions: 12
Compression:
Stored size: 598 Bytes
Contents
# encoding: utf-8 module Nanoc3::Filters class ERB < Nanoc3::Filter # Runs the content through [ERB](http://ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html). # This method takes no options. # # @param [String] content The content to filter # # @return [String] The filtered content def run(content, params={}) require 'erb' # Create context context = ::Nanoc3::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
12 entries across 12 versions & 1 rubygems