Sha256: 7c140739aa07bff290cc5089691737615cbfd33aad8f4111d548f23fdf429bc3

Contents?: true

Size: 876 Bytes

Versions: 41

Compression:

Stored size: 876 Bytes

Contents

module Locomotive
  module Steam
    module Liquid
      module Tags

        class Hybrid < ::Liquid::Block

          def render_as_block?
            @render_as_block
          end

          def parse(tokens)
            if @render_as_block = find_block_delimiter?(tokens)
              super
            else
              @body  = nil
              @blank = false
            end
          end

          def find_block_delimiter?(tokens)
            tokens.each do |token|
              next if token.empty?
              if token.start_with?(::Liquid::BlockBody::TAGSTART)
                if token =~ ::Liquid::BlockBody::FullToken
                  return false  if $1 == @tag_name
                  return true   if $1 == block_delimiter
                end
              end
            end
            false
          end

        end

      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
locomotivecms_steam-1.5.0.rc0 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.5.0.beta3 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.5.0.beta2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.5.0.beta1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.4.1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.4.0 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.4.0.rc2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.4.0.rc1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.4.0.pre.rc.1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.3.0 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.3.0.rc2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.1.2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.2.1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.3.0.rc1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.2.0 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.2.0.rc3 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.2.0.rc2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.2.0.rc1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.2.0.beta1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.1.1 lib/locomotive/steam/liquid/tags/hybrid.rb