paginator 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/History.txt +4 -0
  2. data/lib/paginator.rb +2 -1
  3. metadata +2 -2
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.0.1 / 2006-10-24
2
+
3
+ * Made Paginator#page more accepting, and set it to default to 1
4
+
1
5
  == 1.0.0 / 2006-10-23
2
6
 
3
7
  * Initial release
data/lib/paginator.rb CHANGED
@@ -2,7 +2,7 @@ require 'forwardable'
2
2
 
3
3
  class Paginator
4
4
 
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
 
7
7
  class ArgumentError < ::ArgumentError; end
8
8
  class MissingCountError < ArgumentError; end
@@ -51,6 +51,7 @@ class Paginator
51
51
 
52
52
  # Retrieve page object by number
53
53
  def page(number)
54
+ number = (n = number.to_i) > 0 ? n : 1
54
55
  Page.new(self, number, lambda{ @select.call((number - 1) * @per_page, @per_page) })
55
56
  end
56
57
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: paginator
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2006-10-23 00:00:00 -06:00
6
+ version: 1.0.1
7
+ date: 2006-10-24 00:00:00 -06:00
8
8
  summary: A generic paginator object for use in any Ruby program
9
9
  require_paths:
10
10
  - lib