haml.rb 474 Bytes
Newer Older
Laurent Briais's avatar
Laurent Briais committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
module PowerStencil
  module Engine
    module Renderers

      module Haml

        private

        def render_haml_template(source, context)
          logger.debug "Using HAML to render file '#{source}'"
          ::Haml::Engine.new(File.read source).render(context)
        rescue => e
          logger.debug PowerStencil::Error.report_error(e)
          raise PowerStencil::Error, "Error rendering '#{source}': '#{e.message}'"
        end

      end

    end
  end
end