Sha256: feb09034bd48697ac9337a98d32c78b6542c2cd86481ba0788092e4bc4614230

Contents?: true

Size: 672 Bytes

Versions: 3

Compression:

Stored size: 672 Bytes

Contents

module Locomotive
  module Steam
    module Liquid
      module Tags
        class Hybrid < ::Liquid::Block
          def parse(tokens)
            nesting = 0
            tokens.each do |token|
              next unless token =~ IsTag
              if token =~ FullToken
                if nesting == 0 && $1 == block_delimiter
                  @render_as_block = true
                  super
                  return
                elsif $1 == block_name
                  nesting += 1
                elsif $1 == block_delimiter
                  nesting -= 1
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
locomotivecms_steam-0.1.2.pre.beta lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-0.1.1 lib/locomotive/steam/liquid/tags/hybrid.rb
locomotivecms_steam-0.1.0 lib/locomotive/steam/liquid/tags/hybrid.rb