<commit_before>module StaticHelper
  
  # Reuseable content archive
  def archive(set, display, url=nil)
    # set is the array of objects
    # display is a string we'll use to identify the object attribute to be used for the link's display text ie "title"
    # url is the same as above but for the href of the link
    
    content = ''
    
    set.each do |s|
      
      # Create an h1 with the object's updated_at year, but only once for each year
      unless s.updated_at.year == set[(set.index(s))-1].updated_at.year && s != set.first 
        content << content_tag(:li) do
          content_tag(:h1, s.updated_at.year, :class => 'goudy')
        end
      end
    
      # Create an h2 with the object's updated_at month, but only once for each month
      unless s.updated_at.month == set[(set.index(s))-1].updated_at.month && s != set.first
        content << content_tag(:li) do
          content_tag(:h2, s.updated_at.strftime("%B"))
        end
      end
      
      # Either use the specified url argument as the object's url attribute or the object path itself
      url.nil? ? @url = s : @url = s.url
    
      # Creat the li and the link
      content << content_tag(:li) do
        link_to(s[display], @url)
      end
    end
    
    # Package it all up
    content_tag(:div, :class => 'archiveContainer') do 
      content_tag(:ul, content)<commit_msg>links archive and archive helper<commit_after>module StaticHelper
  
  # Reuseable content archive
  def archive(set, display, url=nil)
    # set is the array of objects
    # display is a string we'll use to identify the object attribute to be used for the link's display text ie "title"
    # url is the same as above but for the href of the link
    
    content = ''
    
    set.each do |s|
      
      # Create an h1 with the object's updated_at year, but only once for each year
      unless s.updated_at.year == set[(set.index(s))-1].updated_at.year && s != set.first 
        content << content_tag(:li) do
          content_tag(:h1, s.updated_at.year, :class => 'goudy')
        end
      end
    
      # Create an h2 with the object's updated_at month, but only once for each month
      unless s.updated_at.month == set[(set.index(s))-1].updated_at.month && s != set.first
        content << content_tag(:li) do
          content_tag(:h2, s.updated_at.strftime("%B"))
        end
      end
      
      # Either use the url argument as the object's url attribute or the object path itself
      url.nil? ? @url = s : @url = s.url
    
      # Creat the li and the link
      content << content_tag(:li) do
        link_to(s[display], @url)
      end
    end
    
    # Package it all up
    content_tag(:div, :class => 'archiveContainer') do 
      content_tag(:ul, content)
{'fraction_non_alphanumeric': 0.0983014094687387, 'fraction_numerical': 0.0043368268883267076, 'mean_word_length': 2.367396593673966, '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': '4795186', 'n_tokens_mistral': 850, 'n_tokens_neox': 830, 'n_words': 304}