<commit_before>require 'spiderfw/templates/template_blocks'

module Spider; module TemplateBlocks
    
    class TagIf < Block
        
        def compile
            init = ""
            cond = vars_to_scene(@el.attributes['sp:tag-if'])
            @el.remove_attribute('sp:tag-if')
            html = HTML.new(@el, @template)
            c = "if (#{cond})\n"
            c += "  $out <<  '#{html.get_start}'\n"
            c += "end\n"
            c, init = html.compile_content(c, init)
            tag_end = html.get_end
            if (tag_end)
                c += "if (#{cond})\n"<commit_msg>Added compile options to TagIf<commit_after>require 'spiderfw/templates/template_blocks'

module Spider; module TemplateBlocks
    
    class TagIf < Block
        
        def compile(options={})
            init = ""
            cond = vars_to_scene(@el.attributes['sp:tag-if'])
            @el.remove_attribute('sp:tag-if')
            html = HTML.new(@el, @template)
            c = "if (#{cond})\n"
            c += "  $out <<  '#{html.get_start(options)}'\n"
            c += "end\n"
            c, init = html.compile_content(c, init, options)
            tag_end = html.get_end
            if (tag_end)
                c += "if (#{cond})\n"
{'fraction_non_alphanumeric': 0.14411529223378702, 'fraction_numerical': 0.0, 'mean_word_length': 1.7056277056277056, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3818138', 'n_tokens_mistral': 388, 'n_tokens_neox': 385, 'n_words': 78}