pagy 2.1.0 → 2.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: 231b1787febd199766fff19ee9e1f8a25b9ba94e92491f9899ea91b98cad82c3
4
- data.tar.gz: 94c21814452385052d0a1ed3085074e1cc69c60534a9525d66946e3f556d32a7
3
+ metadata.gz: 2226375f9b2e7c4789d60aa45d08ba7f5842fc00caa3980586e0f1cf51a611ee
4
+ data.tar.gz: 76aedcccf63588b2dd27e83e5b616485b36a768383e424df7048c863433e9f80
5
5
  SHA512:
6
- metadata.gz: 206e2c4afb1398260ab713f2d85b6628c1594af65a857455b491c27788367b2a90f1f9eb9b943a2f4fcf6355f928d4228f36e76229e77cd75b9611c80a93c81a
7
- data.tar.gz: d2690104a7de7e789600837504bed1f7f8d227d395d8a57c39cd51b3fc0ad3ed44522d0ee4211c29da1bc04603f36ce2116312e87afefe327b49dd75eec16d63
6
+ metadata.gz: 4992b2396dc45b7226ae0de2d6cde8bacd93716152ef8a0f6b5fb643387451527db0d3f2bc5f830e361ea0e3fb789e4a3d343b4f16a828f9764912ad2531213e
7
+ data.tar.gz: 459cb889d1c9ee9b653a0db42cb54923fa3755d42260482c66aa077244d1cd54a15323e769b8683a371dab6186c93eaf20c74214c15660de37d3139a9e31be98
@@ -60,8 +60,8 @@
60
60
 
61
61
  # Breakpoints var used by the responsive nav helpers
62
62
  # See https://ddnexus.github.io/pagy/extras/plain#breakpoints
63
- # Pagy::VARS[:breakpoints] = { 0 => [1,2,2,1], 350 => [2,3,3,2], 550 => [3,4,4,3] } # example of width/size pairs
64
-
63
+ # width/size pairs: example for bootstrap4 sm-md-lg internal container widths
64
+ # Pagy::VARS[:breakpoints] = { 0 => [1,0,0,1], 540 => [2,3,3,2], 720 => [3,4,4,3] }
65
65
 
66
66
  # Feature Extras
67
67
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  require 'pathname'
6
6
 
7
- class Pagy ; VERSION = '2.1.0'
7
+ class Pagy ; VERSION = '2.1.1'
8
8
 
9
9
  class OverflowError < StandardError; attr_reader :pagy; def initialize(pagy) @pagy = pagy end; end
10
10
 
@@ -13,10 +13,12 @@ class Pagy
13
13
  module Helpers
14
14
  # This works with all Rack-based frameworks (Sinatra, Padrino, Rails, ...)
15
15
  def pagy_url_for(page, pagy, path_or_url=:path)
16
- p_vars = pagy.vars; params = request.GET; params[p_vars[:page_param].to_s] = page; params.merge!(p_vars[:params])
16
+ p_vars = pagy.vars; params = request.GET.merge(p_vars[:params]); params[p_vars[:page_param].to_s] = page
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
+
20
22
  # Sub-method called only by #pagy_url_for: here for easy customization of params by overriding
21
23
  def pagy_get_params(params) params end
22
24
  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.0
4
+ version: 2.1.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: 2019-03-12 00:00:00.000000000 Z
11
+ date: 2019-03-13 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,