api-pagination 5.0.0 → 6.0.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: ba0df72041cd862671500fd9efe94c7fe8e35975877e0e9bbcd1c0b77860e4a4
4
- data.tar.gz: debcf49e29dcda50d93cd31a2e9efec2332541dbe38f6bdaa488b450e5bb7d09
3
+ metadata.gz: 0aeee41828ccf353b3be509b5ddc10f180cb238d9b12bb8c357dc3ddfd35f07e
4
+ data.tar.gz: d2e33f4bf383e78f99d9e0d5ee6878e6fa54c8f9ad7412de18d23cadf45ec650
5
5
  SHA512:
6
- metadata.gz: 4661d9bfa18456e1c6fcfb837ef4c3acbc9e35dd983299201340dc077056e3f5632c39a8f718b285d66b4e3985aec23da68a56c8c278f0fc850f27626352bb0b
7
- data.tar.gz: 688fae38d680fb9f1b133a627172d687c7fa6f56186039a88a5bfe238e396c5310359266580644d7719b981d6f3589ac884f6b6d88688c497c8516cbffd122cd
6
+ metadata.gz: c45ef1013c9a791da01d230be2f1a719af87a658b7ba7ab5a2643959eebe9bed8c7935f591f3077a8ed9db5822d561299a9fad87b8347faa3d45b7e6bab70cfc
7
+ data.tar.gz: 81e9f814f3ba16bcf86f1a07a26d7ac951e1dbc8a13221e9ef6db207861389ee301b6cb2c1923ff3deffc5718bc203070c0f4b77fca64535abe26f62590fdd6f
@@ -1,6 +1,6 @@
1
1
  module ApiPagination
2
2
  class Version
3
- MAJOR = 5
3
+ MAJOR = 6
4
4
  MINOR = 0
5
5
  PATCH = 0
6
6
 
@@ -50,14 +50,14 @@ module ApiPagination
50
50
  if Pagy::DEFAULT[:max_per_page] && options[:per_page] > Pagy::DEFAULT[:max_per_page]
51
51
  options[:per_page] = Pagy::DEFAULT[:max_per_page]
52
52
  elsif options[:per_page] <= 0
53
- options[:per_page] = Pagy::DEFAULT[:items]
53
+ options[:per_page] = Pagy::DEFAULT[:limit]
54
54
  end
55
55
 
56
56
  pagy = pagy_from(collection, options)
57
57
  collection = if collection.respond_to?(:offset) && collection.respond_to?(:limit)
58
- collection.offset(pagy.offset).limit(pagy.items)
58
+ collection.offset(pagy.offset).limit(pagy.limit)
59
59
  else
60
- collection[pagy.offset, pagy.items]
60
+ collection[pagy.offset, pagy.limit]
61
61
  end
62
62
 
63
63
  return [collection, pagy]
@@ -70,7 +70,7 @@ module ApiPagination
70
70
  count = collection.is_a?(Array) ? collection.count : collection.count(:all)
71
71
  end
72
72
 
73
- Pagy.new(count: count, items: options[:per_page], page: options[:page])
73
+ Pagy.new(count: count, limit: options[:per_page], page: options[:page])
74
74
  end
75
75
 
76
76
  def pagy_pages_from(pagy)
data/spec/rails_spec.rb CHANGED
@@ -286,7 +286,7 @@ describe NumbersController, :type => :controller do
286
286
 
287
287
  expect(response.header['Per-Page']).to eq(
288
288
  case ApiPagination.config.paginator
289
- when :pagy then Pagy::DEFAULT[:items].to_s
289
+ when :pagy then Pagy::DEFAULT[:limit].to_s
290
290
  when :kaminari then Kaminari.config.default_per_page.to_s
291
291
  when :will_paginate then WillPaginate.per_page.to_s
292
292
  end
@@ -301,7 +301,7 @@ describe NumbersController, :type => :controller do
301
301
 
302
302
  expect(response.header['Per-Page']).to eq(
303
303
  case ApiPagination.config.paginator
304
- when :pagy then Pagy::DEFAULT[:items].to_s
304
+ when :pagy then Pagy::DEFAULT[:limit].to_s
305
305
  when :kaminari then Kaminari.config.default_per_page.to_s
306
306
  when :will_paginate then WillPaginate.per_page.to_s
307
307
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-pagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Celis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-26 00:00:00.000000000 Z
11
+ date: 2024-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari
@@ -36,20 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '5.1'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 5.1.2
39
+ version: '9.0'
43
40
  type: :development
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
44
  - - "~>"
48
45
  - !ruby/object:Gem::Version
49
- version: '5.1'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 5.1.2
46
+ version: '9.0'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: will_paginate
55
49
  requirement: !ruby/object:Gem::Requirement
@@ -213,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
207
  - !ruby/object:Gem::Version
214
208
  version: '0'
215
209
  requirements: []
216
- rubygems_version: 3.2.22
210
+ rubygems_version: 3.5.16
217
211
  signing_key:
218
212
  specification_version: 4
219
213
  summary: Link header pagination for Rails and Grape APIs. Don't use the request body.