1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/hamlit/template.rb
Takashi Kokubun 563441f6e8 Flip frozen_string_literal flag
to pass failing tests.
2016-08-27 02:48:48 +09:00

28 lines
615 B
Ruby

# frozen_string_literal: false
require 'temple'
require 'hamlit/engine'
require 'hamlit/helpers'
# Load tilt/haml first to override if available
begin
require 'haml'
rescue LoadError
else
require 'tilt/haml'
end
module Hamlit
Template = Temple::Templates::Tilt.create(
Hamlit::Engine,
register_as: :haml,
)
module TemplateExtension
# Activate Hamlit::Helpers for tilt templates.
# https://github.com/judofyr/temple/blob/v0.7.6/lib/temple/mixins/template.rb#L7-L11
def compile(*)
"extend Hamlit::Helpers; #{super}"
end
end
Template.send(:extend, TemplateExtension)
end