Sha256: 7413d47620a5701a9fa7cae85af49db86a94193228df35f6544fb131fac21689

Contents?: true

Size: 585 Bytes

Versions: 17

Compression:

Stored size: 585 Bytes

Contents

require 'rails'
require 'temple'

module Hamlit
  class Railtie < ::Rails::Railtie
    initializer :hamlit do |app|
      Hamlit::RailsTemplate = Temple::Templates::Rails.create(
        Hamlit::Engine,
        generator:   Temple::Generators::RailsOutputBuffer,
        register_as: :haml,
        escape_html: true,
        streaming:   true,
        ugly:        true,
      )

      # Haml extends Haml::Helpers in ActionView each time.
      # It costs much, so Hamlit includes a compatible module at first.
      ActionView::Base.send :include, Hamlit::Helpers
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
hamlit-0.5.3 lib/hamlit/railtie.rb
hamlit-0.5.2 lib/hamlit/railtie.rb
hamlit-0.5.1 lib/hamlit/railtie.rb
hamlit-0.5.0 lib/hamlit/railtie.rb
hamlit-0.4.3 lib/hamlit/railtie.rb
hamlit-0.4.2 lib/hamlit/railtie.rb
hamlit-0.4.1 lib/hamlit/railtie.rb
hamlit-0.3.4 lib/hamlit/railtie.rb
hamlit-0.3.3 lib/hamlit/railtie.rb
hamlit-0.3.2 lib/hamlit/railtie.rb
hamlit-0.3.1 lib/hamlit/railtie.rb
hamlit-0.3.0 lib/hamlit/railtie.rb
hamlit-0.2.0 lib/hamlit/railtie.rb
hamlit-0.1.3 lib/hamlit/railtie.rb
hamlit-0.1.2 lib/hamlit/railtie.rb
hamlit-0.1.1 lib/hamlit/railtie.rb
hamlit-0.1.0 lib/hamlit/railtie.rb