pagy 3.8.2 → 3.12.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb6594ae7a224e823f3796f39c8c3603b0dd1c37f7883b362a2654d2cd85e9c3
4
- data.tar.gz: 9fda3ae984287802b2f8a91d52cea1b9c88a3b406f0d0982fb357680f49b0bee
3
+ metadata.gz: 579eed5284017d67002b2def3cc82fab990b416c9b89226bdea2ec210677a014
4
+ data.tar.gz: b4fd177fbae68205121d79437dda967646aa593e45569934142a35546224c87e
5
5
  SHA512:
6
- metadata.gz: f2c47131206f194b5306d1c3f476405baf6e53265ee8e9fcf12bd86926605b767a9357ba699f2399aef597c89f362ed31b88571080b39453285ebeae6fd19d0a
7
- data.tar.gz: c9a427a85448b69a1890d792e6f49192276c16c2c9b062d7a6c74c263d64fb3b39b39217598187b0dff38a69fe7f5dd3a16b4e3bfc7c613cc220222519134134
6
+ metadata.gz: c5eba45292ec4f0c25047830e9c761aa081b6365e95be4ba09e5917c52ca59e9d956fccf376e6c7fb821fc318363a5078ce72abbfa83b6d11603a13953d3a476
7
+ data.tar.gz: b25ac2fcc23d996ff77f14b6f539d34e972a3c41178a790dc0697c92082243ec33fafe834639c4fce8acf3bfa11c77f78ca725d2f2b01f91665af9f2def43b6b
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017-2019 Domizio Demichelis
3
+ Copyright (c) 2017-2020 Domizio Demichelis
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/lib/config/pagy.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- # Pagy initializer file (3.8.2)
4
+ # Pagy initializer file (3.12.0)
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  function Pagy(){}
4
4
 
5
- Pagy.version = '3.8.2';
5
+ Pagy.version = '3.12.0';
6
6
 
7
7
  Pagy.init = function(arg){
8
8
  var target = arg instanceof Event || arg === undefined ? document : arg,
@@ -0,0 +1,24 @@
1
+ # :east_slavic pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
2
+
3
+ bs:
4
+ pagy:
5
+
6
+ item_name:
7
+ one: "stavka"
8
+ few: "stavke"
9
+ many: "stavki"
10
+ other: "stavki"
11
+
12
+ nav:
13
+ prev: "‹ Prethodna"
14
+ next: "Sljedeća  ›"
15
+ gap: "…"
16
+
17
+ info:
18
+ no_items: "Nije pronađena %{item_name}"
19
+ single_page: "Prikazuje se <b>%{count}</b> %{item_name}"
20
+ multiple_pages: "Prikaz %{item_name} <b>%{from}-%{to}</b> od <b>%{count}</b> ukupno"
21
+
22
+ combo_nav_js: "Stranica %{page_input} od %{pages}"
23
+
24
+ items_selector_js: "Prikaži %{items_input} %{item_name} po stranici"
@@ -0,0 +1,22 @@
1
+ # :czech pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
2
+
3
+ cs:
4
+ pagy:
5
+ item_name:
6
+ one: "položka"
7
+ few: "položek"
8
+ other: "položky"
9
+
10
+ nav:
11
+ prev: "&lsaquo;&nbsp;Předchozí"
12
+ next: "Další&nbsp;&rsaquo;"
13
+ gap: "&hellip;"
14
+
15
+ info:
16
+ no_items: "Nic nebylo nalezeno"
17
+ single_page: "Zobrazeno <b>%{count}</b> %{item_name}"
18
+ multiple_pages: "Zobrazeno %{item_name} <b>%{from}-%{to}</b> z <b>%{count}</b> celkem"
19
+
20
+ combo_nav_js: "Strana %{page_input} z %{pages}"
21
+
22
+ items_selector_js: "Zobrazit %{items_input} %{item_name} na stránce"
@@ -0,0 +1,24 @@
1
+ # :east_slavic pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
2
+
3
+ hr:
4
+ pagy:
5
+
6
+ item_name:
7
+ one: "stavka"
8
+ few: "stavke"
9
+ many: "stavki"
10
+ other: "stavki"
11
+
12
+ nav:
13
+ prev: "&lsaquo;&nbsp;Prethodna"
14
+ next: "Sljedeća &nbsp;&rsaquo;"
15
+ gap: "&hellip;"
16
+
17
+ info:
18
+ no_items: "Nije pronađena %{item_name}"
19
+ single_page: "Prikazuje se <b>%{count}</b> %{item_name}"
20
+ multiple_pages: "Prikaz %{item_name} <b>%{from}-%{to}</b> od <b>%{count}</b> ukupno"
21
+
22
+ combo_nav_js: "Stranica %{page_input} od %{pages}"
23
+
24
+ items_selector_js: "Prikaži %{items_input} %{item_name} po stranici"
@@ -0,0 +1,22 @@
1
+ # :one_other pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
2
+
3
+ pt:
4
+ pagy:
5
+
6
+ item_name:
7
+ one: "item"
8
+ other: "itens"
9
+
10
+ nav:
11
+ prev: "&lsaquo;&nbsp;Anterior"
12
+ next: "Próximo&nbsp;&rsaquo;"
13
+ gap: "&hellip;"
14
+
15
+ info:
16
+ no_items: "Sem resultados"
17
+ single_page: "Mostrando %{count} %{item_name}"
18
+ multiple_pages: "Mostrando %{item_name} %{from}-%{to} de um total de %{count}"
19
+
20
+ combo_nav_js: "Página %{page_input} de %{pages}"
21
+
22
+ items_selector_js: "Mostrar %{items_input} %{item_name} por página"
@@ -0,0 +1,23 @@
1
+ # :east_slavic pluralization (see https://github.com/ddnexus/pagy/blob/master/lib/locales/utils/p11n.rb)
2
+
3
+ sr:
4
+ pagy:
5
+ item_name:
6
+ one: "ставка"
7
+ few: "ставкe"
8
+ many: "ставки"
9
+ other: "ставки"
10
+
11
+ nav:
12
+ prev: "&lsaquo;&nbsp;Претходна"
13
+ next: "Следећa &nbsp;&rsaquo;"
14
+ gap: "&hellip;"
15
+
16
+ info:
17
+ no_items: "Нema пронађених %{item_name}"
18
+ single_page: "Приказује се <b>%{count}</b> %{item_name}"
19
+ multiple_pages: "Приказ %{item_name} <b>%{from}-%{to}</b> од <b>%{count}</b> укупно"
20
+
21
+ combo_nav_js: "Страниca %{page_input} од %{pages}"
22
+
23
+ items_selector_js: "Прикажи %{items_input} %{item_name} по страниcи"
@@ -0,0 +1,22 @@
1
+ # :one_other pluralization
2
+
3
+ sw:
4
+ pagy:
5
+
6
+ item_name:
7
+ one: "kifaa"
8
+ other: "vifaa"
9
+
10
+ nav:
11
+ prev: "&lsaquo;&nbsp;Awali"
12
+ next: "Ifuatayo&nbsp;&rsaquo;"
13
+ gap: "&hellip;"
14
+
15
+ info:
16
+ no_items: "Hamna %{item_name} vilivyopatikana"
17
+ single_page: "Inaonyesha %{item_name} <b>%{count}</b>"
18
+ multiple_pages: "Inaonyesha %{item_name} <b>%{from}-%{to}</b> ya <b>%{count}</b> kwa jumla"
19
+
20
+ combo_nav_js: "Kurasa %{page_input} ya %{pages}"
21
+
22
+ items_selector_js: "Onyesha %{items_input} %{item_name} kwa kila ukurasa"
@@ -32,6 +32,13 @@ p11n = {
32
32
  end
33
33
  end,
34
34
 
35
+ west_slavic: lambda do |n|
36
+ if n == 1 ; 'one'
37
+ elsif [2, 3, 4].include?(n) ; 'few'
38
+ else ; 'other'
39
+ end
40
+ end,
41
+
35
42
  one_two_other: lambda do |n|
36
43
  if n == 1 ; 'one'
37
44
  elsif n == 2 ; 'two'
@@ -60,19 +67,23 @@ p11n = {
60
67
  # The default pluralization for locales not explicitly listed here
61
68
  # is the :one_other pluralization proc (used for English)
62
69
  plurals = Hash.new(p11n[:one_other]).tap do |hash|
70
+ hash['bs'] = p11n[:east_slavic]
71
+ hash['cs'] = p11n[:west_slavic]
63
72
  hash['id'] = p11n[:other]
64
73
  hash['fr'] = p11n[:one_upto_two_other]
74
+ hash['hr'] = p11n[:east_slavic]
65
75
  hash['ja'] = p11n[:other]
76
+ hash['km'] = p11n[:other]
66
77
  hash['ko'] = p11n[:other]
67
78
  hash['pl'] = p11n[:polish]
68
79
  hash['ru'] = p11n[:east_slavic]
80
+ hash['sr'] = p11n[:east_slavic]
69
81
  hash['sv'] = p11n[:one_two_other]
70
82
  hash['sv-SE'] = p11n[:one_two_other]
71
83
  hash['tr'] = p11n[:other]
72
84
  hash['zh-CN'] = p11n[:other]
73
85
  hash['zh-HK'] = p11n[:other]
74
86
  hash['zh-TW'] = p11n[:other]
75
- hash['km'] = p11n[:other]
76
87
  end
77
88
 
78
89
  [ plurals, p11n ]
data/lib/pagy.rb CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  require 'pathname'
6
6
 
7
- class Pagy ; VERSION = '3.8.2'
7
+ class Pagy ; VERSION = '3.12.0'
8
8
 
9
9
  # Root pathname to get the path of Pagy files like templates or dictionaries
10
10
  def self.root; @root ||= Pathname.new(__FILE__).dirname.freeze end
@@ -24,7 +24,7 @@ class Pagy
24
24
  def pagy_combo_nav_js(pagy, id=pagy_id)
25
25
  link, p_prev, p_next, p_page, p_pages = pagy_link_proc(pagy), pagy.prev, pagy.next, pagy.page, pagy.pages
26
26
 
27
- html = EMPTY + %(<nav id="#{id}" class="pagy-combo-nav-js-js pagination" role="navigation" aria-label="pager">)
27
+ html = EMPTY + %(<nav id="#{id}" class="pagy-combo-nav-js pagination" role="navigation" aria-label="pager">)
28
28
  html << (p_prev ? %(<span class="page prev">#{link.call p_prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"'}</span> )
29
29
  : %(<span class="page prev disabled">#{pagy_t('pagy.nav.prev')}</span> ))
30
30
  input = %(<input type="number" min="1" max="#{p_pages}" value="#{p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length+1}rem;">)
@@ -15,15 +15,23 @@ class Pagy
15
15
  end
16
16
 
17
17
  def pagy_prev_link(pagy, text = pagy_t('pagy.nav.prev'), link_extra = '')
18
- pagy.prev ? %(<span class="page prev"><a href="#{pagy_prev_url(pagy)}" rel="prev" aria-label="previous" #{pagy.vars[:link_extra]} #{link_extra}>#{text}</a></span>)
18
+ pagy.prev ? %(<span class="page prev"><a href="#{pagy_url_for(pagy.prev, pagy)}" rel="prev" aria-label="previous" #{pagy.vars[:link_extra]} #{link_extra}>#{text}</a></span>)
19
19
  : %(<span class="page prev disabled">#{text}</span>)
20
20
  end
21
21
 
22
22
  def pagy_next_link(pagy, text = pagy_t('pagy.nav.next'), link_extra = '')
23
- pagy.next ? %(<span class="page next"><a href="#{pagy_next_url(pagy)}" rel="next" aria-label="next" #{pagy.vars[:link_extra]} #{link_extra}>#{text}</a></span>)
23
+ pagy.next ? %(<span class="page next"><a href="#{pagy_url_for(pagy.next, pagy)}" rel="next" aria-label="next" #{pagy.vars[:link_extra]} #{link_extra}>#{text}</a></span>)
24
24
  : %(<span class="page next disabled">#{text}</span>)
25
25
  end
26
26
 
27
+ def pagy_prev_link_tag(pagy)
28
+ %(<link href="#{pagy_url_for(pagy.prev, pagy)}" rel="prev"/>) if pagy.prev
29
+ end
30
+
31
+ def pagy_next_link_tag(pagy)
32
+ %(<link href="#{pagy_url_for(pagy.next, pagy)}" rel="next"/>) if pagy.next
33
+ end
34
+
27
35
  end
28
36
 
29
37
  end
data/lib/pagy/frontend.rb CHANGED
@@ -68,6 +68,7 @@ class Pagy
68
68
  end
69
69
 
70
70
  # Similar to I18n.t: just ~18x faster using ~10x less memory
71
+ # (@pagy_locale explicitly initilized in order to avoid warning)
71
72
  def pagy_t(path, vars={}) Pagy::I18n.t(@pagy_locale||=nil, path, vars) end
72
73
 
73
74
  end
data/pagy.gemspec CHANGED
@@ -12,5 +12,5 @@ Gem::Specification.new do |s|
12
12
  s.homepage = 'https://github.com/ddnexus/pagy'
13
13
  s.license = 'MIT'
14
14
  s.files = `git ls-files -z`.split("\x0").select{|f| f.start_with?('lib', 'pagy.gemspec', 'LICENSE') }
15
- s.required_ruby_version = '>= 1.9' # rubocop:disable Gemspec/RequiredRubyVersion
15
+ s.required_ruby_version = ['>= 1.9', '< 3.0']
16
16
  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: 3.8.2
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-12 00:00:00.000000000 Z
11
+ date: 2021-03-12 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,
@@ -24,12 +24,15 @@ files:
24
24
  - lib/javascripts/pagy.js
25
25
  - lib/locales/README.md
26
26
  - lib/locales/bg.yml
27
+ - lib/locales/bs.yml
27
28
  - lib/locales/ca.yml
29
+ - lib/locales/cs.yml
28
30
  - lib/locales/da.yml
29
31
  - lib/locales/de.yml
30
32
  - lib/locales/en.yml
31
33
  - lib/locales/es.yml
32
34
  - lib/locales/fr.yml
35
+ - lib/locales/hr.yml
33
36
  - lib/locales/id.yml
34
37
  - lib/locales/it.yml
35
38
  - lib/locales/ja.yml
@@ -39,9 +42,12 @@ files:
39
42
  - lib/locales/nl.yml
40
43
  - lib/locales/pl.yml
41
44
  - lib/locales/pt-BR.yml
45
+ - lib/locales/pt.yml
42
46
  - lib/locales/ru.yml
47
+ - lib/locales/sr.yml
43
48
  - lib/locales/sv-SE.yml
44
49
  - lib/locales/sv.yml
50
+ - lib/locales/sw.yml
45
51
  - lib/locales/tr.yml
46
52
  - lib/locales/utils/i18n.rb
47
53
  - lib/locales/utils/loader.rb
@@ -104,13 +110,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
110
  - - ">="
105
111
  - !ruby/object:Gem::Version
106
112
  version: '1.9'
113
+ - - "<"
114
+ - !ruby/object:Gem::Version
115
+ version: '3.0'
107
116
  required_rubygems_version: !ruby/object:Gem::Requirement
108
117
  requirements:
109
118
  - - ">="
110
119
  - !ruby/object:Gem::Version
111
120
  version: '0'
112
121
  requirements: []
113
- rubygems_version: 3.1.2
122
+ rubygems_version: 3.1.4
114
123
  signing_key:
115
124
  specification_version: 4
116
125
  summary: The Ultimate Pagination Ruby Gem