Sha256: 109c3fa2e7a47d73aa50bc701db05003de29364811dd6d57cec48b32b04d92b8

Contents?: true

Size: 700 Bytes

Versions: 6

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

module Hanami
  class View
    module Tilt
      module ERB
        def self.requirements
          ["hanami/view/tilt/erbse", <<~ERROR]
            hanami-view requires erbse for full compatibility when rendering .erb templates (e.g. implicitly capturing block content when yielding)

            To ignore this and use another engine for .erb templates, deregister this adapter before calling your views:

            Hanami::View::Tilt.deregister_adapter(:erb)
          ERROR
        end

        def self.activate
          Tilt.default_mapping.register ErbseTemplate, "erb"
          self
        end
      end

      register_adapter :erb, ERB
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hanami-view-2.0.0.alpha8 lib/hanami/view/tilt/erb.rb
hanami-view-2.0.0.alpha7 lib/hanami/view/tilt/erb.rb
hanami-view-2.0.0.alpha6 lib/hanami/view/tilt/erb.rb
hanami-view-2.0.0.alpha5 lib/hanami/view/tilt/erb.rb
hanami-view-2.0.0.alpha3 lib/hanami/view/tilt/erb.rb
hanami-view-2.0.0.alpha2 lib/hanami/view/tilt/erb.rb