kaminari-core 1.2.1 → 1.2.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f97cdb29c6cc0f87f4a3b2439bc98d4015894053aece52f9685f9053d828eee2
|
4
|
+
data.tar.gz: fda4562a4e0fe69e90af6276b78575dc6dbbe6f42f98ffecd70bd54ddf7cf5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dbaec420bee38126a89931872d0d4dcc37772a7bb22d0c97844399b95c55cc4677a2634d1b908b1c4c5c60a0319ab5b88d8b7bb4f01658db3ecc52400eb9c94
|
7
|
+
data.tar.gz: a5294c22cd10b649243d4ebd4ac85481e1ae16b956d2777121926026eb21f2c3ec6c07a799ca02271f0348a76f9cc4fcf409ce0cdbe69672289fdca1e745e800
|
@@ -114,10 +114,10 @@ BANNER
|
|
114
114
|
require 'open-uri'
|
115
115
|
|
116
116
|
def get_files_in_master
|
117
|
-
master_tree_sha = open('https://api.github.com/repos/amatsuda/kaminari_themes/git/refs/heads/master') do |json|
|
117
|
+
master_tree_sha = URI.open('https://api.github.com/repos/amatsuda/kaminari_themes/git/refs/heads/master') do |json|
|
118
118
|
ActiveSupport::JSON.decode(json.read)['object']['sha']
|
119
119
|
end
|
120
|
-
open('https://api.github.com/repos/amatsuda/kaminari_themes/git/trees/' + master_tree_sha + '?recursive=1') do |json|
|
120
|
+
URI.open('https://api.github.com/repos/amatsuda/kaminari_themes/git/trees/' + master_tree_sha + '?recursive=1') do |json|
|
121
121
|
blobs = ActiveSupport::JSON.decode(json.read)['tree'].find_all {|i| i['type'] == 'blob' }
|
122
122
|
blobs.map do |blob|
|
123
123
|
[blob['path'], blob['sha']]
|
@@ -127,7 +127,7 @@ BANNER
|
|
127
127
|
module_function :get_files_in_master
|
128
128
|
|
129
129
|
def get_content_for(path)
|
130
|
-
open('https://api.github.com/repos/amatsuda/kaminari_themes/contents/' + path) do |json|
|
130
|
+
URI.open('https://api.github.com/repos/amatsuda/kaminari_themes/contents/' + path) do |json|
|
131
131
|
Base64.decode64(ActiveSupport::JSON.decode(json.read)['content'])
|
132
132
|
end
|
133
133
|
end
|
@@ -4,14 +4,14 @@ module Kaminari
|
|
4
4
|
module Helpers
|
5
5
|
|
6
6
|
# The Kaminari::Helpers::UrlHelper module provides useful methods for
|
7
|
-
# generating a path or url to a
|
7
|
+
# generating a path or url to a particular page. A class must implement the
|
8
8
|
# following methods:
|
9
9
|
#
|
10
10
|
# * <tt>url_for</tt>: A method that generates an actual path
|
11
11
|
# * <tt>params</tt>: A method that returns query string parameters
|
12
12
|
# * <tt>request</tt>: A method that returns a Rack::Request object
|
13
13
|
#
|
14
|
-
# A normal Rails controller implements all the methods, which
|
14
|
+
# A normal Rails controller implements all the methods, which make it
|
15
15
|
# trivial to use this module:
|
16
16
|
#
|
17
17
|
# ==== Examples
|
@@ -20,10 +20,10 @@ module Kaminari
|
|
20
20
|
# include Kaminari::Helpers::UrlHelper
|
21
21
|
#
|
22
22
|
# def index
|
23
|
-
#
|
23
|
+
# @users = User.page(1)
|
24
24
|
#
|
25
|
-
#
|
26
|
-
#
|
25
|
+
# path_to_next_page(@items)
|
26
|
+
# # => /items?page=2
|
27
27
|
# end
|
28
28
|
# end
|
29
29
|
#
|
@@ -41,7 +41,12 @@ module Kaminari
|
|
41
41
|
def next_page_url(scope, options = {})
|
42
42
|
"#{request.base_url}#{next_page_path(scope, options)}" if scope.next_page
|
43
43
|
end
|
44
|
-
alias
|
44
|
+
alias url_to_next_page next_page_url
|
45
|
+
|
46
|
+
def path_to_next_url(scope, options = {})
|
47
|
+
ActiveSupport::Deprecation.warn 'path_to_next_url is deprecated. Use next_page_url or url_to_next_page instead.'
|
48
|
+
next_page_url(scope, options)
|
49
|
+
end
|
45
50
|
|
46
51
|
# A helper that calculates the url to the previous page.
|
47
52
|
#
|
@@ -226,15 +231,15 @@ module Kaminari
|
|
226
231
|
# <%= rel_next_prev_link_tags @items %>
|
227
232
|
# <% end %>
|
228
233
|
#
|
229
|
-
# #-> <link rel="next" href="/items/page/3"
|
234
|
+
# #-> <link rel="next" href="/items/page/3"><link rel="prev" href="/items/page/1">
|
230
235
|
#
|
231
236
|
def rel_next_prev_link_tags(scope, options = {})
|
232
237
|
next_page = path_to_next_page(scope, options)
|
233
238
|
prev_page = path_to_prev_page(scope, options)
|
234
239
|
|
235
240
|
output = String.new
|
236
|
-
output << %Q|<link rel="next" href="#{next_page}"
|
237
|
-
output << %Q|<link rel="prev" href="#{prev_page}"
|
241
|
+
output << %Q|<link rel="next" href="#{next_page}">| if next_page
|
242
|
+
output << %Q|<link rel="prev" href="#{prev_page}">| if prev_page
|
238
243
|
output.html_safe
|
239
244
|
end
|
240
245
|
end
|
@@ -13,7 +13,7 @@ module Kaminari
|
|
13
13
|
# class, so _tag partial is not needed).
|
14
14
|
# e.g.) PrevLink -> app/views/kaminari/_prev_link.html.erb
|
15
15
|
#
|
16
|
-
# When no matching
|
16
|
+
# When no matching templates were found in your app, the engine's pre
|
17
17
|
# installed template will be used.
|
18
18
|
# e.g.) Paginator -> $GEM_HOME/kaminari-x.x.x/app/views/kaminari/_paginator.html.erb
|
19
19
|
class Tag
|
@@ -66,7 +66,7 @@ module Kaminari
|
|
66
66
|
"kaminari",
|
67
67
|
@theme,
|
68
68
|
self.class.name.demodulize.underscore
|
69
|
-
].compact.join("/")
|
69
|
+
].compact.join("/").gsub('//', '/')
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,7 +91,7 @@ homepage: https://github.com/kaminari/kaminari
|
|
91
91
|
licenses:
|
92
92
|
- MIT
|
93
93
|
metadata: {}
|
94
|
-
post_install_message:
|
94
|
+
post_install_message:
|
95
95
|
rdoc_options: []
|
96
96
|
require_paths:
|
97
97
|
- lib
|
@@ -106,8 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
rubygems_version: 3.
|
110
|
-
signing_key:
|
109
|
+
rubygems_version: 3.3.0.dev
|
110
|
+
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Kaminari's core pagination library
|
113
113
|
test_files: []
|