Sha256: 1516797e7d0448e02ad563a1ec060d9f34205811cd5bbc285e7992f4090efe93

Contents?: true

Size: 793 Bytes

Versions: 42

Compression:

Stored size: 793 Bytes

Contents

require 'spiderfw/templates/template_blocks'

module Spider; module TemplateBlocks
    
    class TagIf < Block
        
        def compile(options={})
            init = ""
            cond = vars_to_scene(@el.get_attribute('sp:tag-if'))
            @el.remove_attribute('sp:tag-if')
            html = HTML.new(@el, @template)
            c = "if (#{cond})\n"
            c += html.get_start(options)
            c += "end\n"
            c, init = html.compile_content(c, init, options)
            tag_end = html.get_end(options)
            if (tag_end)
                c += "if (#{cond})\n"
                c += "  $out <<  '#{tag_end}'\n"
                c += "end\n"
            end
            return CompiledBlock.new(init, c)
        end
        
        
    end
    
    
end; end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
spiderfw-1.0.1 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-1.0.0 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.39 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.38 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.37 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.35 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.34 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.33 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.32 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.31 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.30 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.29 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.28 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.27 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.26 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.26.pre1 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.25 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.24 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.23 lib/spiderfw/templates/blocks/tag_if.rb
spiderfw-0.6.22 lib/spiderfw/templates/blocks/tag_if.rb