Sha256: 2c22e94b7dd578c5b91c42a631a258bd012d1215329185b006ce5bd863b8eb9b

Contents?: true

Size: 488 Bytes

Versions: 4

Compression:

Stored size: 488 Bytes

Contents

require 'haml'
require 'haml/engine'

class StaticMatic::TemplateHandlers::Haml < ActionView::TemplateHandler
  include ActionView::TemplateHandlers::Compilable

  def compile(template, local_assigns = {})
    options = StaticMatic::Config[:haml_options].dup
    options[:filename] = template.filename

    ::Haml::Engine.new(template.source, options).send(:precompiled_with_ambles, [])
  end
end

ActionView::Template.register_template_handler(:haml, StaticMatic::TemplateHandlers::Haml)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tdreyno-staticmatic-2.1.1 lib/staticmatic/template_handlers/haml.rb
tdreyno-staticmatic-2.1.3 lib/staticmatic/template_handlers/haml.rb
tdreyno-staticmatic-2.1.4 lib/staticmatic/template_handlers/haml.rb
tdreyno-staticmatic-2.9.0 lib/staticmatic/template_handlers/haml.rb