pagy 3.2.0 → 3.2.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: 1c340603d318a1982f676209661b8357a2c386c93e6144c0f950dbad19645a23
4
- data.tar.gz: 13bd39e2660aff66151c245801a8502320392cd0e62faf82f6042caf45e59603
3
+ metadata.gz: 660aa79dcf4de07d2377f7f7706897a14e637eae0f8ddff1799094361da5e76c
4
+ data.tar.gz: eef332aa68f610aa89df84822d91c99274facf0c84162268c5a7d0c97a28163e
5
5
  SHA512:
6
- metadata.gz: f2562e79aa12b299e2e4594d595255d3de4e401ef406c0b2a6228ab2924226905cd4531fbf9c0f563c3680f8e56ef0d13229b3a25be26e6c590cbc1073f9b944
7
- data.tar.gz: 302da621bcf61a0a2ae97e4ed96d0e7477abec46d50bf3128ed850ff1edf1b5f88e6bcc3f79161907051f4015cf158e37a6bbcfd001609557decbd7569b979a1
6
+ metadata.gz: cff58fe6379393d1156aafa83a85fdc0d3ebfa6e8d193215e42f7d40c59fb3f476420325ae1cce84624d8b11dddf670f874cb1fbf69c40f7a7b32f6cf6db3752
7
+ data.tar.gz: 718f1a9dd1f829488228e9e4620938f48ea471b40b89ccabf610ff76b73811b57b25a5c9729ca7147ae8bbefce8b82f73d37fe76a95d9fb037c6571fe6078ee7
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- # Pagy initializer file (3.2.0)
4
+ # Pagy initializer file (3.2.1)
5
5
  # Customize only what you really need and notice that Pagy works also without any of the following lines.
6
6
  # Should you just cherry pick part of this file, please maintain the require-order of the extras
7
7
 
@@ -98,6 +98,6 @@ Pagy.addInputEventListeners = function(input, handler){
98
98
  };
99
99
 
100
100
  Pagy.trim = function(html, param){
101
- var re = new RegExp('[?&]' + param + '=1(?![&])|(?<=[?&])' + param + '=1&');
101
+ var re = new RegExp('[?&]' + param + '=1\b(?!&)|\b' + param + '=1&');
102
102
  return html.replace(re, '');
103
103
  };
@@ -4,7 +4,7 @@
4
4
 
5
5
  require 'pathname'
6
6
 
7
- class Pagy ; VERSION = '3.2.0'
7
+ class Pagy ; VERSION = '3.2.1'
8
8
 
9
9
  class OverflowError < StandardError; attr_reader :pagy; def initialize(pagy) @pagy = pagy end; end
10
10
 
@@ -10,9 +10,9 @@ class Pagy
10
10
 
11
11
  Pagy::I18n.clear.instance_eval { undef :load; undef :t } # unload the pagy default constant for efficiency
12
12
 
13
- alias :pagy_without_i18n :pagy_t
13
+ alias_method :pagy_without_i18n, :pagy_t
14
14
  def pagy_t_with_i18n(*args) ::I18n.t(*args) end
15
- alias :pagy_t :pagy_t_with_i18n
15
+ alias_method :pagy_t, :pagy_t_with_i18n
16
16
 
17
17
  end
18
18
  end
@@ -10,7 +10,7 @@ class Pagy
10
10
 
11
11
  def overflow?; @overflow end
12
12
 
13
- alias :initialize_without_overflow :initialize
13
+ alias_method :initialize_without_overflow, :initialize
14
14
  def initialize_with_overflow(vars)
15
15
  @overflow ||= false # don't override if :last_page re-run the method after an overflow
16
16
  initialize_without_overflow(vars)
@@ -31,7 +31,7 @@ class Pagy
31
31
  raise ArgumentError, "expected :overflow variable in [:last_page, :empty_page, :exception]; got #{@vars[:overflow].inspect}"
32
32
  end
33
33
  end
34
- alias :initialize :initialize_with_overflow
34
+ alias_method :initialize, :initialize_with_overflow
35
35
 
36
36
  module Series
37
37
  def series(size=@vars[:size])
@@ -48,7 +48,7 @@ class Pagy
48
48
  if defined?(Pagy::Countless)
49
49
  class Countless
50
50
 
51
- alias :finalize_without_overflow :finalize
51
+ alias_method :finalize_without_overflow, :finalize
52
52
  def finalize_with_overflow(items)
53
53
  @overflow = false
54
54
  finalize_without_overflow(items)
@@ -65,7 +65,7 @@ class Pagy
65
65
  raise ArgumentError, "expected :overflow variable in [:empty_page, :exception]; got #{@vars[:overflow].inspect}"
66
66
  end
67
67
  end
68
- alias :finalize :finalize_with_overflow
68
+ alias_method :finalize, :finalize_with_overflow
69
69
 
70
70
  end
71
71
  end
@@ -10,11 +10,11 @@ class Pagy
10
10
 
11
11
  alias_method :pagy_link_proc_without_trim, :pagy_link_proc
12
12
  def pagy_link_proc_with_trim(pagy, link_extra='')
13
- link_proc = pagy_link_proc_without_trim(pagy, link_extra)
14
- page_param = pagy.vars[:page_param]
13
+ link_proc = pagy_link_proc_without_trim(pagy, link_extra)
14
+ re = /[?&]#{pagy.vars[:page_param]}=1\b(?!&)|\b#{pagy.vars[:page_param]}=1&/
15
15
  lambda do |n, text=n, extra=''|
16
16
  link = link_proc.call(n, text, extra)
17
- n == 1 ? link.sub(/[?&]#{page_param}=1(?![&])|\b(?<=[?&])#{page_param}=1&/, '') : link
17
+ n == 1 ? link.sub(re, '') : link
18
18
  end
19
19
  end
20
20
  alias_method :pagy_link_proc, :pagy_link_proc_with_trim
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: 3.2.0
4
+ version: 3.2.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-05-10 00:00:00.000000000 Z
11
+ date: 2019-05-24 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,