pagy 5.1.0 → 5.1.1

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: 46116524913f885ab10fb48fdac0c9b6691654e23abb04f138586791aaca7a3b
4
- data.tar.gz: 911ca803f1f0764484c0440898d384c768c0ed94da1eeac7dd9317a66750b548
3
+ metadata.gz: 5300f9784ba9ab19522910b10e2f100a9823b5b52c91738966e946c91a08702a
4
+ data.tar.gz: 2dc3599be82ee24dba9e8074c1b84e5443d69550ddec6fd32967f66a316ecedd
5
5
  SHA512:
6
- metadata.gz: e2a7dcaf8febf7412f73bb54b2bba3189670faed1e58400ab68e8e0fe1c7de305cbe66be9a848762d2bad31bf8de082c6208ede39ff04027c6b71c283e356220
7
- data.tar.gz: 43ee98762c7e8b1e777dd52d9c550f0b351691f2dad440dc65daeb0328fe1d0f2868830f4b34e75d2b45b10e0530140801bd3e65eb2938cc7ca54a94d65207c4
6
+ metadata.gz: 36b6893409fad1745593238f9a169623841dc4b55172fd2263f0bba09b3436e8c7f4e6f5ff6fc65bd56233b510daef44df60238189249547205f17087ddd69ab
7
+ data.tar.gz: bddaf3afe21358ed1b9ed73de5585931f4dac9018cc37b30c268aae29cdd7f836ac4f77e4ea419f9268dc4f9f247907996ab2461cd6fc6a44d9e80467b513567
data/lib/config/pagy.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Pagy initializer file (5.1.0)
3
+ # Pagy initializer file (5.1.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
 
@@ -3,7 +3,7 @@
3
3
  // Container of the whole pagy stuff
4
4
  function Pagy(){}
5
5
 
6
- Pagy.version = '5.1.0'
6
+ Pagy.version = '5.1.1'
7
7
 
8
8
  // Used by the waitForMe function
9
9
  Pagy.delay = 100
@@ -34,15 +34,15 @@ class Pagy
34
34
  # it works exactly as the regular #pagy_url_for, relying on the params method and Rack.
35
35
  # If there is a defined pagy.vars[:url] variable it does not need the params method nor Rack.
36
36
  def pagy_url_for(pagy, page, absolute: nil)
37
- vars = pagy.vars
38
- return super unless (url = vars[:url])
37
+ p_vars = pagy.vars
38
+ return super unless (url = p_vars[:url])
39
39
 
40
- params = vars[:params]
41
- params[vars[:page_param]] = page
42
- params[vars[:items_param]] = vars[:items] if vars[:items_extra]
40
+ params = p_vars[:params]
41
+ params[p_vars[:page_param].to_s] = page
42
+ params[p_vars[:items_param].to_s] = p_vars[:items] if defined?(ItemsExtra)
43
43
 
44
44
  query_string = "?#{QueryUtils.build_nested_query(pagy_massage_params(params))}"
45
- "#{url}#{query_string}#{vars[:fragment]}"
45
+ "#{url}#{query_string}#{p_vars[:fragment]}"
46
46
  end
47
47
  end
48
48
  # In ruby 3+ `UrlHelpers.prepend StandaloneExtra` would be enough instead of using the next 2 lines
@@ -7,13 +7,13 @@ class Pagy
7
7
  # It supports all Rack-based frameworks (Sinatra, Padrino, Rails, ...).
8
8
  # For non-rack environments you can use the standalone extra
9
9
  def pagy_url_for(pagy, page, absolute: nil)
10
- vars = pagy.vars
11
- params = self.params.merge(vars[:params])
12
- params[vars[:page_param]] = page
13
- params[vars[:items_param]] = vars[:items] if vars[:items_extra]
10
+ p_vars = pagy.vars
11
+ params = request.GET.merge(p_vars[:params])
12
+ params[p_vars[:page_param].to_s] = page
13
+ params[p_vars[:items_param].to_s] = p_vars[:items] if defined?(ItemsExtra)
14
14
 
15
15
  query_string = "?#{Rack::Utils.build_nested_query(pagy_massage_params(params))}"
16
- "#{request.base_url if absolute}#{request.path}#{query_string}#{vars[:fragment]}"
16
+ "#{request.base_url if absolute}#{request.path}#{query_string}#{p_vars[:fragment]}"
17
17
  end
18
18
 
19
19
  # Sub-method called only by #pagy_url_for: here for easy customization of params by overriding
data/lib/pagy.rb CHANGED
@@ -5,7 +5,7 @@ require 'pathname'
5
5
 
6
6
  # Core class
7
7
  class Pagy
8
- VERSION = '5.1.0'
8
+ VERSION = '5.1.1'
9
9
 
10
10
  # Root pathname to get the path of Pagy files like templates or dictionaries
11
11
  def self.root
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagy
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis