pagy 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/config/pagy.rb +1 -1
- data/lib/pagy.rb +1 -1
- data/lib/pagy/extras/headers.rb +2 -1
- data/lib/pagy/frontend.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb2ad8b0a66d5a1d73d3e9424e7cf24982bd8afe30a19d9ecb4b128900045785
|
4
|
+
data.tar.gz: 185999aba7ea86b9db281ea40895c73825db1468800b64f27bdae7490a7e789e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe5a44fb9a9f0c6d6ea55cfa1ac88af5001ef9fbdb9b6093a63c8d1ab70f4cde3d38c451d9ea8d697c077a02e339d20e901fd80dd51d0d7b9fde508c0841f071
|
7
|
+
data.tar.gz: b3e76636525450e4dcb91abd60db0c466cdeae202b5590a2238adb55aa60df53646b75d958251c1428bccc4e171011a288500f61a7b787a442d9addff0937e25
|
data/lib/config/pagy.rb
CHANGED
@@ -68,7 +68,7 @@
|
|
68
68
|
# Headers extra: http response headers (and other helpers) useful for API pagination
|
69
69
|
# See http://ddnexus.github.io/pagy/extras/headers
|
70
70
|
# require 'pagy/extras/headers'
|
71
|
-
# Pagy::VARS[:headers] = { items: 'Page-Items', count: 'Total-Count', pages: 'Total-Pages' } # default
|
71
|
+
# Pagy::VARS[:headers] = { page: 'Current-Page', items: 'Page-Items', count: 'Total-Count', pages: 'Total-Pages' } # default
|
72
72
|
|
73
73
|
# Support extra: Extra support for features like: incremental, infinite, auto-scroll pagination
|
74
74
|
# See https://ddnexus.github.io/pagy/extras/support
|
data/lib/pagy.rb
CHANGED
data/lib/pagy/extras/headers.rb
CHANGED
@@ -6,7 +6,7 @@ class Pagy
|
|
6
6
|
# Add specialized backend methods to add pagination response headers
|
7
7
|
module Backend ; private
|
8
8
|
|
9
|
-
VARS[:headers] = { items: 'Page-Items', count: 'Total-Count', pages: 'Total-Pages' }
|
9
|
+
VARS[:headers] = { page: 'Current-Page', items: 'Page-Items', count: 'Total-Count', pages: 'Total-Pages' }
|
10
10
|
|
11
11
|
include Helpers
|
12
12
|
|
@@ -26,6 +26,7 @@ class Pagy
|
|
26
26
|
url_str = pagy_url_for(Frontend::MARKER, pagy, :url)
|
27
27
|
hash = { 'Link' => Hash[rels.map{|rel, n|[rel, url_str.sub(Frontend::MARKER, n.to_s)] if n}.compact] }
|
28
28
|
headers = pagy.vars[:headers]
|
29
|
+
hash[headers[:page]] = pagy.page if headers[:page]
|
29
30
|
hash[headers[:items]] = pagy.vars[:items] if headers[:items]
|
30
31
|
unless countless
|
31
32
|
hash[headers[:pages]] = pagy.pages if headers[:pages]
|
data/lib/pagy/frontend.rb
CHANGED
@@ -17,8 +17,6 @@ class Pagy
|
|
17
17
|
"#{request.send(path_or_url)}?#{Rack::Utils.build_nested_query(pagy_get_params(params))}#{p_vars[:anchor]}"
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
20
|
# Sub-method called only by #pagy_url_for: here for easy customization of params by overriding
|
23
21
|
def pagy_get_params(params) params end
|
24
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Agnostic pagination in plain ruby: it works with any framework, ORM
|
14
14
|
and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays,
|