Sha256: 0aa78968231526a851b4edb0720465c4b34eb92a69f78f6a76115c74a6b65506

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

module Inky
  module Rails
    class TemplateHandler
      def self.erb_handler
        @@erb_handler ||= ActionView::Template.registered_template_handler(:erb)
      end

      def self.call(template)
        compiled_source = erb_handler.call(template)
        "Inky::Core.new.release_the_kraken(begin; #{compiled_source};end)"
      end
    end
  end
end

ActiveSupport.on_load(:action_view) do
  ActionView::Template.register_template_handler :inky, Inky::Rails::TemplateHandler
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inky-rb-1.3.6.1 lib/inky/rails/template_handler.rb
inky-rb-1.3.6.0 lib/inky/rails/template_handler.rb
inky-rb-0.0.3 lib/inky/rails/template_handler.rb
inky-rb-0.0.2 lib/inky/rails/template_handler.rb