Sha256: 141fe04ff82d0c966f996591191154f4f291e3c373e68940a417812ae65a74bd

Contents?: true

Size: 1.95 KB

Versions: 7

Compression:

Stored size: 1.95 KB

Contents

# frozen_string_literal: true

module PlatformosCheck
  module Tags
    # Copied tags parsing code from storefront-renderer

    class ContentFor < BaseBlock; end

    class Yield < Base; end

    class IncludeForm < Base
      class ParseTreeVisitor < Liquid::ParseTreeVisitor
        def children
          [
            @node.main_value
          ] + @node.attributes_expr.values
        end
      end
    end

    class << self
      attr_writer :register_tags

      def register_tags?
        @register_tags
      end

      def register_tag(name, klass)
        Liquid::Template.register_tag(name, klass)
      end

      def register_tags!
        return if !register_tags? || (defined?(@registered_tags) && @registered_tags)

        @registered_tags = true
        register_tag('form', Form)
        register_tag('include_form', IncludeForm)
        register_tag('render', Render)
        register_tag('theme_render', ThemeRender)
        register_tag('theme_render_rc', ThemeRender)
        register_tag('log', Log)
        register_tag('cache', Cache)
        register_tag('print', Print)
        register_tag('parse_json', ParseJson)
        register_tag('try_rc', Try)
        register_tag('try', Try)
        register_tag('export', Export)
        register_tag('return', Return)
        register_tag('redirect_to', RedirectTo)
        register_tag('response_headers', ResponseHeaders)
        register_tag('response_status', ResponseStatus)
        register_tag('hash_assign', HashAssign)
        register_tag('background', Background)
        register_tag('content_for', ContentFor)
        register_tag('session', Session)
        register_tag('context', Context)
        register_tag('context_rc', Context)
        register_tag('sign_in', SignIn)
        register_tag('yield', Yield)
        register_tag('graphql', Graphql)
        register_tag('function', Function)
        register_tag('spam_protection', SpamProtection)
      end
    end
    self.register_tags = true
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
platformos-check-0.4.14 lib/platformos_check/tags.rb
platformos-check-0.4.13 lib/platformos_check/tags.rb
platformos-check-0.4.12 lib/platformos_check/tags.rb
platformos-check-0.4.11 lib/platformos_check/tags.rb
platformos-check-0.4.10 lib/platformos_check/tags.rb
platformos-check-0.4.9 lib/platformos_check/tags.rb
platformos-check-0.4.8 lib/platformos_check/tags.rb