Class: Ace::HamlFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/ace/filters/haml.rb

Instance Method Summary collapse

Methods inherited from Filter

#initialize

Constructor Details

This class inherits a constructor from Ace::Filter

Instance Method Details

#call(item, content) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/ace/filters/haml.rb', line 10

def call(item, content)
  if item.output_path && item.output_path.end_with?(".haml")
    item.output_path.sub!(/\.haml$/, "")
  end

  engine = Haml::Engine.new(content)
  engine.render(item.extend(Ace::Helpers))
end