Class: Opal::Haml::HamlProcessor

Inherits:
BuilderProcessors::RubyProcessor
  • Object
show all
Defined in:
lib/opal/haml/builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ HamlProcessor

Returns a new instance of HamlProcessor.



8
9
10
11
# File 'lib/opal/haml/builder.rb', line 8

def initialize(*args)
  super
  @source = prepare(@source, @filename)
end

Instance Method Details

#prepare(source, path) ⇒ Object



17
18
19
20
21
22
# File 'lib/opal/haml/builder.rb', line 17

def prepare(source, path)
  haml = ::Haml::Engine.new(source, :ugly => true).precompiled
  haml = haml.gsub('_hamlout.buffer', '_hamlout')

  ::Opal::Haml.wrap haml, path
end

#requiresObject



13
14
15
# File 'lib/opal/haml/builder.rb', line 13

def requires
  ['opal-haml'] + super
end