Class: MoCo::HamlCompiler

Inherits:
HtmlCompiler show all
Defined in:
lib/moco/compilers/haml_compiler.rb

Instance Attribute Summary

Attributes inherited from Compiler

#compiled_file, #source_file

Instance Method Summary collapse

Methods inherited from HtmlCompiler

compiled_extension, #error_text

Methods inherited from Compiler

#compile, compiled_extension, convert_option, #initialize, options, register, require_library, set_option, #should_compile?, #source_text

Constructor Details

This class inherits a constructor from MoCo::Compiler

Instance Method Details

#compiled_textObject



8
9
10
11
12
13
# File 'lib/moco/compilers/haml_compiler.rb', line 8

def compiled_text
  Haml::Engine.new(source_text, options).render
rescue => e
  e.instance_eval { @line += 1 if @line }
  raise
end

#optionsObject



15
16
17
# File 'lib/moco/compilers/haml_compiler.rb', line 15

def options
  super.merge(:filename => source_file)
end