Module: Haml::Filters::Coffee

Includes:
Base
Defined in:
lib/haml/filters/coffee.rb,
lib/haml/filters/coffee/version.rb

Constant Summary collapse

VERSION =
'0.0.1'

Instance Method Summary collapse

Instance Method Details

#compile(compiler, text) ⇒ Object



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

def compile(compiler, text)
  rendered = CoffeeScript.compile(text)
  compiler.instance_eval do
    push_text(options[:ugly] ?
              rendered.rstrip :
              rendered.rstrip.gsub("\n", "\n#{'  ' * @output_tabs}"))
  end
end