Class: Nanoc2::Filters::ERB
- Inherits:
-
Nanoc2::Filter
- Object
- Plugin
- Nanoc2::Filter
- Nanoc2::Filters::ERB
- Defined in:
- lib/nanoc2/filters/erb.rb
Constant Summary
Constants inherited from Nanoc2::Filter
Nanoc2::Filter::EXTENSIONS_MAP
Constants inherited from Plugin
Instance Method Summary collapse
Methods inherited from Nanoc2::Filter
#assigns, #filename, #initialize
Methods inherited from Plugin
identifier, identifiers, named, register
Constructor Details
This class inherits a constructor from Nanoc2::Filter
Instance Method Details
#run(content) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nanoc2/filters/erb.rb', line 6 def run(content) require 'erb' # Create context context = ::Nanoc2::Extra::Context.new(assigns) # Get result erb = ::ERB.new(content) erb.filename = filename erb.result(context.get_binding) end |