Sha256: 3e6170e81c3bdd75c3486c0a60b29b4cc5a7640efc6b70ec309235a76b453d3d

Contents?: true

Size: 531 Bytes

Versions: 8

Compression:

Stored size: 531 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,
        streaming:   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

8 entries across 8 versions & 1 rubygems

Version Path
hamlit-1.2.1 lib/hamlit/railtie.rb
hamlit-1.2.0 lib/hamlit/railtie.rb
hamlit-1.1.1 lib/hamlit/railtie.rb
hamlit-1.1.0 lib/hamlit/railtie.rb
hamlit-1.0.0 lib/hamlit/railtie.rb
hamlit-0.6.2 lib/hamlit/railtie.rb
hamlit-0.6.1 lib/hamlit/railtie.rb
hamlit-0.6.0 lib/hamlit/railtie.rb