<commit_before>= paginate-simple
The idea for building this gem came up when i was looking for a way to paginate my posts
in a simple sinatra blog that i was building. I needed some kind of pagination that was 
not coupled with any of the existing ORM's.
The abstraction of a paginator should be simple.

It should be able to paginate some collection of data by providing a 
1. total number of items
2. the page
3. and number of items per page

It should be able to answer on the following
1. How many items should i skip (offset)
2. How many items should i get (per_page)
3. Is there a next page and if there is give me the next page.
4. Is there a previous page and if there is give me the previous page.
5. It should be able to give you the first page and the last page.
6. It should be able to provide you a way to iterate over the existing pages.

In the previous version of the gem i have created a PaginateSimple module to work as a
singleton but in this version since it should be a pagination logic i have changed that 
behavior in order to provide a way to extend and change the functionality of the module
and its usage.

Usage:
In order to create a singleton pagination object we need to create a class Paginator that
will extend this module and change some of its built in logic like this:


  class Paginator
    extend PaginateSimple
  
    def self.current_page(page)
      super page.to_i # allow strings to be passed like "1" as well
    end
  end

If we need to have more than one Paginator we will include the module instead and
then instantiate the object as needed. 


  class Paginator
    include PaginateSimple
  
    def current_page(page)
      super page.to_i # allow strings to be passed like "1" as well
    end
  end

  @paginator = Paginator.new
  @paginator.config :total => 100 , :page => 1, :per_page => 10
<commit_msg>Fixed the typo in README for the current_page method<commit_after>= paginate-simple
The idea for building this gem came up when i was looking for a way to paginate my posts
in a simple sinatra blog that i was building. I needed some kind of pagination that was 
not coupled with any of the existing ORM's.
The abstraction of a paginator should be simple.

It should be able to paginate some collection of data by providing a 
1. total number of items
2. the page
3. and number of items per page

It should be able to answer on the following
1. How many items should i skip (offset)
2. How many items should i get (per_page)
3. Is there a next page and if there is give me the next page.
4. Is there a previous page and if there is give me the previous page.
5. It should be able to give you the first page and the last page.
6. It should be able to provide you a way to iterate over the existing pages.

In the previous version of the gem i have created a PaginateSimple module to work as a
singleton but in this version since it should be a pagination logic i have changed that 
behavior in order to provide a way to extend and change the functionality of the module
and its usage.

Usage:
In order to create a singleton pagination object we need to create a class Paginator that
will extend this module and change some of its built in logic like this:


  class Paginator
    extend PaginateSimple
  
    def self.current_page=(page)
      super page.to_i # allow strings to be passed like "1" as well
    end
  end

If we need to have more than one Paginator we will include the module instead and
then instantiate the object as needed. 


  class Paginator
    include PaginateSimple
  
    def current_page=(page)
      super page.to_i # allow strings to be passed like "1" as well
    end
  end

  @paginator = Paginator.new
  @paginator.config :total => 100 , :page => 1, :per_page => 10

{'fraction_non_alphanumeric': 0.03200853560949587, 'fraction_numerical': 0.009069085089357162, 'mean_word_length': 3.427390791027155, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2424071', 'n_tokens_mistral': 1043, 'n_tokens_neox': 990, 'n_words': 648}