<commit_before>module Tabnav
  class Navbar
    def initialize(template, params, options = {}) # :nodoc:
      @template = template
      @params = params
      @html_options = options
      @tabs = []
    end

    # Optionally specifies a partial to be used to render the tab content.
    attr_writer :tab_content_partial

    # Creates a Tab and adds it to the navbar.
    #
    # +options+ is an optional hash of options which will be used to create the +li+ for the tab.
    #
    # yields the created Tab
    def add_tab(options = {})
      options[:tab_content_partial] = @tab_content_partial if @tab_content_partial
      t = Tab.new(@template, @params, options)
      yield t
      @tabs << t
    end

    def render # :nodoc:
      return '' if @tabs.empty?
      @template.content_tag :ul, @html_options do
        contents = ''
        @tabs.each do |tab|
          contents += tab.render
        end
        contents.html_safe
      end
    end
  end
end<commit_msg>html_safe only needed on initial empty string<commit_after>module Tabnav
  class Navbar
    def initialize(template, params, options = {}) # :nodoc:
      @template = template
      @params = params
      @html_options = options
      @tabs = []
    end

    # Optionally specifies a partial to be used to render the tab content.
    attr_writer :tab_content_partial

    # Creates a Tab and adds it to the navbar.
    #
    # +options+ is an optional hash of options which will be used to create the +li+ for the tab.
    #
    # yields the created Tab
    def add_tab(options = {})
      options[:tab_content_partial] = @tab_content_partial if @tab_content_partial
      t = Tab.new(@template, @params, options)
      yield t
      @tabs << t
    end

    def render # :nodoc:
      return '' if @tabs.empty?
      @template.content_tag :ul, @html_options do
        contents = ''.html_safe
        @tabs.each do |tab|
          contents += tab.render
        end
        contents
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08350100603621731, 'fraction_numerical': 0.0, 'mean_word_length': 2.298507462686567, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2807795', 'n_tokens_mistral': 583, 'n_tokens_neox': 578, 'n_words': 204}