geared_pagination 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c0df2ffda60431042065c8239bc92687ff300db3d4e6ffaa0f711334004ce7b
4
- data.tar.gz: 5dbc61434adb9fe75618fb3e0ab075eea9abf90867de2e3f104cf1435b10a91e
3
+ metadata.gz: 05c58b3498b3b341fd11f5500545278837414633b714f7c02aca2c3718c86227
4
+ data.tar.gz: b3c4729222ff73faf62566f48187ae522544a1491a6fba02ff4b921e24c1dcbd
5
5
  SHA512:
6
- metadata.gz: 1a789e055a1a1a6686e64dbd2bffc91e39caca801dfaee071fe6a1afd9a445fc006b01b4df2917dd1befaafb26278331ddadce9d7f2c2714b42c4f98e394632b
7
- data.tar.gz: 0d635bfa95bbedcb9e34111413d60d1fb486dcbc80d2a2567921525fc2170b8e637a4bd65ef9cc2235ed2446c9c3ecfa3060e6ce45cae662eed5c0ec6b785f16
6
+ metadata.gz: c327c83175f3a27a8a91732ab3ae81c3c5d0f0da3ef54726a0d30042e7bb90b4ba933781ccee5b57cc7808c477e9bb12b5e67204e0c2417450a82350eeeadacf
7
+ data.tar.gz: ed877d95bad4a4d4083ee05f02d7211aa9e28c96eaf948cd387baa7b930373d5e08227024268bd1efef46c8fa75f84ac71c297a9080626c9c39ce8148e6e1e1c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geared_pagination (1.0.2)
4
+ geared_pagination (1.1.0)
5
5
  activesupport (>= 5.0)
6
6
  addressable (>= 2.5.0)
7
7
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'geared_pagination'
3
- s.version = '1.0.2'
3
+ s.version = '1.1.0'
4
4
  s.authors = 'David Heinemeier Hansson'
5
5
  s.email = 'david@basecamp.com'
6
6
  s.summary = 'Paginate Active Record sets at variable speeds'
@@ -35,7 +35,11 @@ module GearedPagination
35
35
  end
36
36
 
37
37
  def last?
38
- number >= recordset.page_count
38
+ number == recordset.page_count
39
+ end
40
+
41
+ def before_last?
42
+ number < recordset.page_count
39
43
  end
40
44
 
41
45
 
@@ -20,8 +20,13 @@ class GearedPagination::PageTest < ActiveSupport::TestCase
20
20
  end
21
21
 
22
22
  test "last with page number greater than page count" do
23
- page_for_empty_set = GearedPagination::Recordset.new(Recording.none, per_page: 1000).page(2)
24
- assert page_for_empty_set.last?
23
+ assert_not GearedPagination::Recordset.new(Recording.none, per_page: 1000).page(2).last?
24
+ end
25
+
26
+ test "before_last" do
27
+ assert GearedPagination::Recordset.new(Recording.all, per_page: 1).page(1).before_last?
28
+ assert_not GearedPagination::Recordset.new(Recording.all, per_page: 1000).page(1).before_last?
29
+ assert_not GearedPagination::Recordset.new(Recording.none, per_page: 1000).page(2).before_last?
25
30
  end
26
31
 
27
32
  test "next offset param" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geared_pagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-14 00:00:00.000000000 Z
11
+ date: 2020-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport