<commit_before>module Paginate
  module Helpers
    # Pagination helpers for Merb applications. See Paginate::Helpers::Shared
    # for additional methods
    module Merb
      include Shared
      
      # A quick method for creating pagination links, using a view partial,
      # (layouts/_page_links, by default).
      # Arguments:
      #
      # - +collection+: an enumerable collection with #current_page and
      #   #pages methods.
      # - +partial_name+: location of the partial to use
      # - +padding+: Maximum number of page links before and after current_page.
      def pagination_partial(collection, partial_name = "layout/page_links", padding = 3)
        padding ||= 3
        partial(partial_name, :current_page => collection.current_page, :pages => collection.pages, :padding => padding)
      end
      
      # Returns links for pages, given a +collection+ and optional
      # +padding+ (see Shared#page_set). Returned html will be along the lines
      # of:
      # 
      #    <div class="pageLinks">' +
      #      <span class="pagePrevious"><a href="/list?page=4">&laquo;</a></span>
      #      <span class="pageSpacer">...</span>
      #      <span class="pageNumber"><a href="/list?page=3">3</a></span>
      #      <span class="pageNumber"><a href="/list?page=4">4</a></span>
      #      <span class="pageCurrent">5</span>
      #      <span class="pageNumber"><a href="/list?page=6">6</a></span>
      #      <span class="pageNumber"><a href="/list?page=7">7</a></span>
      #      <span class="pageSpacer">...</span>
      #      <span class="pageNext"><a href="/list?page=6">&raquo;</a></span>
      #    </div>
      #
      # CSS classes are pageSpacer, pageNumber, pageDisabled, pageCurrent, 
      # pagePrevious, and pageNext. pageLinks is the class of the enclosing div.
      def page_links(collection, padding = 3)
        current = collection.current_page
        pages   = collection.pages
        
        tag(:div, :class => 'pageLinks') do
          if current_page == 1
            tag(:span, '&laquo;', :class => 'pageDisabled pagePrevious')
          else
            tag(:a, '&laquo;', :href => page_url(current - 1), :class => 'pagePrevious')
          end
          <commit_msg>Fix incorrect variable name in Helpers::Merb#page_links<commit_after>module Paginate
  module Helpers
    # Pagination helpers for Merb applications. See Paginate::Helpers::Shared
    # for additional methods
    module Merb
      include Shared
      
      # A quick method for creating pagination links, using a view partial,
      # (layouts/_page_links, by default).
      # Arguments:
      #
      # - +collection+: an enumerable collection with #current_page and
      #   #pages methods.
      # - +partial_name+: location of the partial to use
      # - +padding+: Maximum number of page links before and after current_page.
      def pagination_partial(collection, partial_name = "layout/page_links", padding = 3)
        padding ||= 3
        partial(partial_name, :current_page => collection.current_page, :pages => collection.pages, :padding => padding)
      end
      
      # Returns links for pages, given a +collection+ and optional
      # +padding+ (see Shared#page_set). Returned html will be along the lines
      # of:
      # 
      #    <div class="pageLinks">' +
      #      <span class="pagePrevious"><a href="/list?page=4">&laquo;</a></span>
      #      <span class="pageSpacer">...</span>
      #      <span class="pageNumber"><a href="/list?page=3">3</a></span>
      #      <span class="pageNumber"><a href="/list?page=4">4</a></span>
      #      <span class="pageCurrent">5</span>
      #      <span class="pageNumber"><a href="/list?page=6">6</a></span>
      #      <span class="pageNumber"><a href="/list?page=7">7</a></span>
      #      <span class="pageSpacer">...</span>
      #      <span class="pageNext"><a href="/list?page=6">&raquo;</a></span>
      #    </div>
      #
      # CSS classes are pageSpacer, pageNumber, pageDisabled, pageCurrent, 
      # pagePrevious, and pageNext. pageLinks is the class of the enclosing div.
      def page_links(collection, padding = 3)
        current = collection.current_page
        pages   = collection.pages
        
        tag(:div, :class => 'pageLinks') do
          if current == 1
            tag(:span, '&laquo;', :class => 'pageDisabled pagePrevious')
          else
            tag(:a, '&laquo;', :href => page_url(current - 1), :class => 'pagePrevious')
          end
          
{'fraction_non_alphanumeric': 0.14096038946669617, 'fraction_numerical': 0.007081212657667626, 'mean_word_length': 2.520249221183801, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 81, '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': '2534414', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1307, 'n_words': 343}