pagy 3.8.3 → 3.9.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: a5914b35c8067b8d14845b7d9436f7ca4790175d177eef5762f69e436add1f3c
4
- data.tar.gz: e3215ee3eea2b59db1af94ff525e7b1643ba64c55564c7e19971b54f5a2c05b1
3
+ metadata.gz: 76e3d9bead25964339d54c1cd73d9e907da2339e3f06b260f9cee31fa595deca
4
+ data.tar.gz: 6b4babd77239dee7f8d5bdc599fc621aeae42089fd7a2c0689010e1f5f8fafb4
5
5
  SHA512:
6
- metadata.gz: 71ce505f853364f27a64088497d70b0c4a4c4621cb060d719200e76a5f623bcfc4c182b9b716a2ba6005670caf512e717dcf51be13cb181b7b112b2cfc4e95b6
7
- data.tar.gz: 2401ef28c166a69a83567d5fa4f92587be93d2ded49f8261d582acb4df62dff41f5a7773da48a37d26faedf50f7f6da39585beac0fd22fc9ee5419e32c8d1a99
6
+ metadata.gz: d52670d1b6b9e8145589ce948fbbc4332a946fbd955a3a2bdca3acbb591c33cb6e956e83a2a8b9c50545ccd80b709c4f0709296be6330e22031990cbd8e17116
7
+ data.tar.gz: 8e0c0a3ba6d655386de0a50a53e315c854a88319fdafa5792e94fd4f432be263eee420840f54bcbb206b505b26cbf850faa07db6eef66157f91391f5c43ff89f
@@ -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
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  # frozen_string_literal: true
3
3
 
4
- # Pagy initializer file (3.8.3)
4
+ # Pagy initializer file (3.9.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.3';
5
+ Pagy.version = '3.9.0';
6
6
 
7
7
  Pagy.init = function(arg){
8
8
  var target = arg instanceof Event || arg === undefined ? document : arg,
@@ -4,7 +4,7 @@
4
4
 
5
5
  require 'pathname'
6
6
 
7
- class Pagy ; VERSION = '3.8.3'
7
+ class Pagy ; VERSION = '3.9.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
@@ -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
@@ -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
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.3
4
+ version: 3.9.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-07-23 00:00:00.000000000 Z
11
+ date: 2020-10-21 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,