Sha256: ccf534c3ef96693d0d80d869de1dc18ba1be0cdd2ab3c33c64c650653c5cefb9

Contents?: true

Size: 558 Bytes

Versions: 30

Compression:

Stored size: 558 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,
      )

      # 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

30 entries across 30 versions & 1 rubygems

Version Path
hamlit-1.7.2 lib/hamlit/railtie.rb
hamlit-1.7.1 lib/hamlit/railtie.rb
hamlit-1.7.0 lib/hamlit/railtie.rb
hamlit-1.6.7 lib/hamlit/railtie.rb
hamlit-1.6.6 lib/hamlit/railtie.rb
hamlit-1.6.5 lib/hamlit/railtie.rb
hamlit-1.6.4 lib/hamlit/railtie.rb
hamlit-1.6.3 lib/hamlit/railtie.rb
hamlit-1.6.2 lib/hamlit/railtie.rb
hamlit-1.6.1 lib/hamlit/railtie.rb
hamlit-1.6.0 lib/hamlit/railtie.rb
hamlit-1.5.9 lib/hamlit/railtie.rb
hamlit-1.5.8 lib/hamlit/railtie.rb
hamlit-1.5.7 lib/hamlit/railtie.rb
hamlit-1.5.6 lib/hamlit/railtie.rb
hamlit-1.5.5 lib/hamlit/railtie.rb
hamlit-1.5.4 lib/hamlit/railtie.rb
hamlit-1.5.3 lib/hamlit/railtie.rb
hamlit-1.5.2 lib/hamlit/railtie.rb
hamlit-1.5.1 lib/hamlit/railtie.rb