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.1.0 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.1.0.rc3 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.1.0.rc2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.1.0.rc1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc10 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc9 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc8 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc6 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc4 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc3 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.rc1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.pre.beta.3 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.pre.beta.2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.pre.beta.1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.pre.alpha.3 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.pre.alpha.2 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-1.0.0.pre.alpha.1 lib/locomotive/steam/liquid/tags/hybrid.rb