Sha256: 43fed95f3ebd5072e80b69bbb179219743e4e6b3ab6d0cc9d1dac77cdb29e9f3

Contents?: true

Size: 615 Bytes

Versions: 29

Compression:

Stored size: 615 Bytes

Contents

# 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

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hamlit-2.10.0-java lib/hamlit/template.rb
hamlit-2.10.0 lib/hamlit/template.rb
hamlit-2.9.5-java lib/hamlit/template.rb
hamlit-2.9.4-java lib/hamlit/template.rb
hamlit-2.9.5 lib/hamlit/template.rb
hamlit-2.9.4 lib/hamlit/template.rb
hamlit-2.9.3-java lib/hamlit/template.rb
hamlit-2.9.3 lib/hamlit/template.rb
hamlit-2.9.2-java lib/hamlit/template.rb
hamlit-2.9.2 lib/hamlit/template.rb
hamlit-2.9.1-java lib/hamlit/template.rb
hamlit-2.9.1 lib/hamlit/template.rb
hamlit-2.9.0 lib/hamlit/template.rb
hamlit-2.8.10 lib/hamlit/template.rb
hamlit-2.8.8 lib/hamlit/template.rb
hamlit-2.8.7 lib/hamlit/template.rb
hamlit-2.8.6 lib/hamlit/template.rb
hamlit-2.8.5 lib/hamlit/template.rb
hamlit-2.8.4 lib/hamlit/template.rb
hamlit-2.8.3 lib/hamlit/template.rb