pagy 4.8.0 → 4.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/config/pagy.rb +1 -1
- data/lib/javascripts/pagy.js +1 -1
- data/lib/pagy.rb +2 -2
- data/lib/pagy/deprecation.rb +5 -5
- 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: c87ea4c3c1bf0dbfb6ae76db111177cda391165a844ff3302f8ee2722249ef2f
|
4
|
+
data.tar.gz: 26618714b6555f46cb9c140166b3407efb350bf8263cfcb8bdd4bde293265ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e0026cc9cb9051f43c3b89a3d68bde3fbb738ea21055117da0427e0dba9eae6c1d501dcd76d5dadd68890609fde321d33372fe8c949cf8c03c3388e4aa61317
|
7
|
+
data.tar.gz: 643f315b5de922a30f47f70465e7e13d7a5837835b6da90cf52cdf491eaec75f66450678094a3cbef0f38d65afd280ddafec0e0dc16dc52a479e324b896655dd
|
data/lib/config/pagy.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Pagy initializer file (4.8.
|
3
|
+
# Pagy initializer file (4.8.1)
|
4
4
|
# Customize only what you really need and notice that Pagy works also without any of the following lines.
|
5
5
|
# Should you just cherry pick part of this file, please maintain the require-order of the extras
|
6
6
|
|
data/lib/javascripts/pagy.js
CHANGED
data/lib/pagy.rb
CHANGED
@@ -5,7 +5,7 @@ require 'pathname'
|
|
5
5
|
|
6
6
|
# main class
|
7
7
|
class Pagy
|
8
|
-
VERSION = '4.8.
|
8
|
+
VERSION = '4.8.1'
|
9
9
|
|
10
10
|
# Root pathname to get the path of Pagy files like templates or dictionaries
|
11
11
|
def self.root
|
@@ -23,7 +23,7 @@ class Pagy
|
|
23
23
|
# Merge and validate the options, do some simple arithmetic and set the instance variables
|
24
24
|
def initialize(vars)
|
25
25
|
@vars = VARS.merge( vars.delete_if{|k,v| VARS.key?(k) && (v.nil? || v == '') } )
|
26
|
-
@vars[:fragment] = deprecated_var(:anchor, @vars[:anchor], :fragment, @vars[:fragment]) if @vars[:anchor]
|
26
|
+
@vars[:fragment] = Pagy.deprecated_var(:anchor, @vars[:anchor], :fragment, @vars[:fragment]) if @vars[:anchor]
|
27
27
|
|
28
28
|
INSTANCE_VARS_MIN.each do |name,min|
|
29
29
|
raise VariableError.new(self), "expected :#{name} >= #{min}; got #{@vars[name].inspect}" \
|
data/lib/pagy/deprecation.rb
CHANGED
@@ -4,22 +4,22 @@ class Pagy
|
|
4
4
|
|
5
5
|
# deprecated variables
|
6
6
|
def deprecated_var(var, val, new_var, new_val)
|
7
|
-
value =
|
8
|
-
Warning.warn %([PAGY WARNING] deprecated use of
|
7
|
+
value = val || new_val
|
8
|
+
Warning.warn %([PAGY WARNING] deprecated use of '#{var}' var will not be supported in 5.0! Use '#{new_var}: #{value.inspect}' instead.)
|
9
9
|
value
|
10
10
|
end
|
11
11
|
|
12
12
|
# deprecated pagy_url_for argument order
|
13
13
|
def deprecated_order(pagy, page)
|
14
|
-
Warning.warn
|
14
|
+
Warning.warn %([PAGY WARNING] inverted use of pagy/page in pagy_url_for will not be supported in 5.0! Use pagy_url_for(pagy, page) instead.)
|
15
15
|
[page, pagy]
|
16
16
|
end
|
17
17
|
|
18
18
|
|
19
19
|
# deprecated posiitioal arguments
|
20
20
|
def deprecated_arg(arg, val, new_key, new_val)
|
21
|
-
value =
|
22
|
-
Warning.warn %([PAGY WARNING] deprecated use of positional
|
21
|
+
value = val || new_val # we use the new_val if present
|
22
|
+
Warning.warn %([PAGY WARNING] deprecated use of positional '#{arg}' arg will not be supported in 5.0! Use only the keyword arg '#{new_key}: #{value.inspect}' instead.)
|
23
23
|
value
|
24
24
|
end
|
25
25
|
|
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: 4.8.
|
4
|
+
version: 4.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Domizio Demichelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-14 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,
|