<commit_before>module LayoutHelper
  def breadcrumbs
    result = render_navigation context: :main, renderer: :breadcrumbs_without_method_links, join_with: ' &gt; '
    result = result && result.scan('<a').length > 1 ? result : ''
    
    if respond_to?(:resource) && resource.respond_to?(:ancestors)
      breadcrumbs_with_ancestors(result)
    else
      result
    end
  end
  
  def breadcrumbs_with_ancestors(links)
    links = links.split(' &gt; ')
    current_resource_link = links.pop
    links += resource.ancestors.map {|ancestor| link_to ancestor.name, ancestor }
    links << current_resource_link
    raw links.join(' &gt; ')    
  end
  
  def sidenav(links_count = 2)
    links_count ||= 2
    result = render_navigation context: :main, renderer: :twitter_sidenav, level: @twitter_sidenav_level
    result && result.scan('<a').length >= links_count ? result : ''
  end
  
  def footer_navigation
    links = []
    
    ['privacy-policy', 'terms-of-use', 'about-us'].each do |page_name|
      text = t("pages.#{page_name.gsub('-', '_')}.title")
      path = "#{controller_name}/#{params[:id]}"
      active = path == "#{controller_name}/#{page_name}"
      links << (active ? text : link_to(text, page_path(page_name)))
    end
    
    raw links.join(' | ')
  end
end<commit_msg>Replace :main by application_navigation.<commit_after>module LayoutHelper
  def breadcrumbs
    result = render_navigation context: application_navigation, renderer: :breadcrumbs_without_method_links, join_with: ' &gt; '
    result = result && result.scan('<a').length > 1 ? result : ''
    
    if respond_to?(:resource) && resource.respond_to?(:ancestors)
      breadcrumbs_with_ancestors(result)
    else
      result
    end
  end
  
  def breadcrumbs_with_ancestors(links)
    links = links.split(' &gt; ')
    current_resource_link = links.pop
    links += resource.ancestors.map {|ancestor| link_to ancestor.name, ancestor }
    links << current_resource_link
    raw links.join(' &gt; ')    
  end
  
  def sidenav(links_count = 2)
    links_count ||= 2
    result = render_navigation context: application_navigation, renderer: :twitter_sidenav, level: @twitter_sidenav_level
    
    result && result.scan('<a').length >= links_count ? result : ''
  end
  
  def footer_navigation
    links = []
    
    ['privacy-policy', 'terms-of-use', 'about-us'].each do |page_name|
      text = t("pages.#{page_name.gsub('-', '_')}.title")
      path = "#{controller_name}/#{params[:id]}"
      active = path == "#{controller_name}/#{page_name}"
      links << (active ? text : link_to(text, page_path(page_name)))
    end
    
    raw links.join(' | ')
  end
end
{'fraction_non_alphanumeric': 0.13920240782543267, 'fraction_numerical': 0.002257336343115124, 'mean_word_length': 3.4464882943143813, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, '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': '4093675', 'n_tokens_mistral': 881, 'n_tokens_neox': 882, 'n_words': 178}