bridgetown-paginate 1.2.0.beta4 → 1.2.0.beta5

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: 9d99e5854dd4323784082d6378f766a1d913fb9e9c935f9b9cd7d9f27241ee5e
4
- data.tar.gz: 56a11c006dac3e642773d08b5ba2de05166b9064f57ba62a212b3b43155ff79d
3
+ metadata.gz: 41849b7f3c758ce965d222b490fd3d787974f38b857b3f87212a7b4fb3ae8d37
4
+ data.tar.gz: d8f6fec78fb9899ec2ee518fb6b87164923baadfc16382d2329712a7c53ebf27
5
5
  SHA512:
6
- metadata.gz: b11ee6a61f2c6802c4f50a6ec7d1c565605c8dfcb703866c19c637f03c991d7a9a6a50d2c45be51862ba703ec68dc30d47a7499dfe8ef15818d256f89655fb8d
7
- data.tar.gz: 370336cb3f229296b694316159a6244ee8ada3cd32204309448f3739158360f39162f996b610dcceca658d531a934f997d55f4d6805c26e5b5b5ab18a5a3442a
6
+ metadata.gz: a53e6464af7e309012b4bb63b50814c691e27bc67360bd549480cb0059ef85c7fe8698a9ff73533c144cfccc4e6636ef799f92fb3375593dad6b2a55b5b5db3a
7
+ data.tar.gz: 20cd38b8b435f0ffa737245bcb65018d6b234dba8453ed0ac94bd7e064adcb06d077181305b6c7a19aedfd9d33c5eade09f2514d90871c6e9c3c5577c608b1ae
@@ -33,11 +33,7 @@ module Bridgetown
33
33
  end
34
34
 
35
35
  init = (@page - 1) * @per_page
36
- offset = if init + @per_page - 1 >= documents.size
37
- documents.size
38
- else
39
- init + @per_page - 1
40
- end
36
+ offset = [init + @per_page - 1, documents.size].min
41
37
 
42
38
  # Ensure that the current page has correct extensions if needed
43
39
  this_page_url = Utils.ensure_full_path(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.beta4
4
+ version: 1.2.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-07 00:00:00.000000000 Z
11
+ date: 2023-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.0.beta4
19
+ version: 1.2.0.beta5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.0.beta4
26
+ version: 1.2.0.beta5
27
27
  description:
28
28
  email: maintainers@bridgetownrb.com
29
29
  executables: []