kaminari-core 1.3.1 → 1.3.3

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: f09015e67e4c0831c62e845c58430afc160b6369fe478541ff4958b30f317a75
4
- data.tar.gz: 543968d5603c02ab552b7a94a931b2d6acfeaacfb06fe69aeacfaf683977e511
3
+ metadata.gz: 0ec3fb8bf1c167b2db6bdcef98ebf6b96c6132525977c15eac23154c05fe486b
4
+ data.tar.gz: 16a19d46d7955f46fd66bbafa639cb894d4ffbae9daa8a8dd447d62b9f82e45a
5
5
  SHA512:
6
- metadata.gz: f12687d4ad5c970229c48f04c5efd54b6c88f2611af1ed0f0f54cc496144bc1aea32e516415645cfabb2e35d01daa7cd15275cfa6cc29cbf927f706423c8bd61
7
- data.tar.gz: c0333b6a8c4e39e77982ee156835bb85fd2c4326a0f21afa80468dd8eebcccaac25511e5e149ad4380ad513e0a08e231ad09b008c1f77ccbc273d7b052ae13fc
6
+ metadata.gz: 17eab9de4ace52058860a29bbbb7449d72887fad65409a8bb383fbf4e597eaeef1813182fc9f8f6b2c2956ef8d1b148c580bcf7248c0da8a7d4fa49c18d68b3f
7
+ data.tar.gz: d7de884270d9a05b91d30c66f039a9ff28f0b88c71e6d7da5b4e5e64522dcd6768be1c8ea7042750c01e7a6ed2ef93447bd7bc643fc377df2fe3935cf33f3d81
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kaminari
4
4
  module Core
5
- VERSION = '1.3.1'
5
+ VERSION = '1.3.3'
6
6
  end
7
7
  end
@@ -109,6 +109,7 @@ module Kaminari
109
109
  # * <tt>:right</tt> - The "right outer window" size (0 by default).
110
110
  # * <tt>:params</tt> - url_for parameters for the links (:controller, :action, etc.)
111
111
  # * <tt>:param_name</tt> - parameter name for page number in the links (:page by default)
112
+ # * <tt>:format</tt> - format for the links (e.g. <tt>:turbo_stream</tt>), a shortcut for <tt>params: {format: ...}</tt>
112
113
  # * <tt>:remote</tt> - Ajax? (false by default)
113
114
  # * <tt>:data</tt> - data-* attributes for the links (e.g. <tt>{turbo_frame: 'users'}</tt>)
114
115
  # * <tt>:paginator_class</tt> - Specify a custom Paginator (Kaminari::Helpers::Paginator by default)
@@ -143,7 +144,7 @@ module Kaminari
143
144
  def link_to_previous_page(scope, name, **options)
144
145
  prev_page = path_to_prev_page(scope, options)
145
146
 
146
- options.except! :params, :param_name
147
+ options.except! :params, :param_name, :format
147
148
  options[:rel] ||= 'prev'
148
149
 
149
150
  if prev_page
@@ -174,7 +175,7 @@ module Kaminari
174
175
  def link_to_next_page(scope, name, **options)
175
176
  next_page = path_to_next_page(scope, options)
176
177
 
177
- options.except! :params, :param_name
178
+ options.except! :params, :param_name, :format
178
179
  options[:rel] ||= 'next'
179
180
 
180
181
  if next_page
@@ -65,7 +65,9 @@ module Kaminari
65
65
  path, keys = partial_path, locals.keys
66
66
  cached_keys, template = @partial_cache[path]
67
67
  unless template && (cached_keys == keys)
68
- template = @template.lookup_context.find_template(path, [], true, keys)
68
+ lookup_context = @template.lookup_context
69
+ # LookupContext#find no longer raises MissingTemplate but returns nil since Rails 8.2, where find! raises instead
70
+ template = lookup_context.respond_to?(:find!) ? lookup_context.find!(path, [], true, keys) : lookup_context.find(path, [], true, keys)
69
71
  @partial_cache[path] = [keys, template]
70
72
  end
71
73
  # `render partial:` in Action View 4 also puts the partial name into local_assigns (e.g. {gap: nil, ...})
@@ -82,6 +84,7 @@ module Kaminari
82
84
  def generate_page_url(page)
83
85
  params = params_for(page)
84
86
  params[:only_path] = true
87
+ params[:format] = @options[:format] if @options[:format]
85
88
  @template.url_for params
86
89
  end
87
90
 
metadata CHANGED
@@ -1,118 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaminari-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
- - Akira Matsuda
7
+ - Akira Matsuda
8
8
  bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: bundler
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- -
17
- - ">="
18
- - !ruby/object:Gem::Version
19
- version: "1.13"
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- -
25
- - ">="
26
- - !ruby/object:Gem::Version
27
- version: "1.13"
28
- - !ruby/object:Gem::Dependency
29
- name: rake
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- -
33
- - ">="
34
- - !ruby/object:Gem::Version
35
- version: "10.0"
36
- type: :development
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- -
41
- - ">="
42
- - !ruby/object:Gem::Version
43
- version: "10.0"
44
- description: kaminari-core includes pagination logic independent from ORMs and view libraries
12
+ - !ruby/object:Gem::Dependency
13
+ name: bundler
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '1.13'
19
+ type: :development
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '1.13'
26
+ - !ruby/object:Gem::Dependency
27
+ name: rake
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '10.0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '10.0'
40
+ description: kaminari-core includes pagination logic independent from ORMs and view
41
+ libraries
45
42
  email:
46
- - ronnie@dio.jp
43
+ - ronnie@dio.jp
47
44
  executables: []
48
45
  extensions: []
49
46
  extra_rdoc_files: []
50
47
  files:
51
- - CHANGELOG.md
52
- - MIT-LICENSE
53
- - README.md
54
- - app/views/kaminari/_first_page.html.erb
55
- - app/views/kaminari/_first_page.html.haml
56
- - app/views/kaminari/_first_page.html.slim
57
- - app/views/kaminari/_gap.html.erb
58
- - app/views/kaminari/_gap.html.haml
59
- - app/views/kaminari/_gap.html.slim
60
- - app/views/kaminari/_last_page.html.erb
61
- - app/views/kaminari/_last_page.html.haml
62
- - app/views/kaminari/_last_page.html.slim
63
- - app/views/kaminari/_next_page.html.erb
64
- - app/views/kaminari/_next_page.html.haml
65
- - app/views/kaminari/_next_page.html.slim
66
- - app/views/kaminari/_page.html.erb
67
- - app/views/kaminari/_page.html.haml
68
- - app/views/kaminari/_page.html.slim
69
- - app/views/kaminari/_paginator.html.erb
70
- - app/views/kaminari/_paginator.html.haml
71
- - app/views/kaminari/_paginator.html.slim
72
- - app/views/kaminari/_prev_page.html.erb
73
- - app/views/kaminari/_prev_page.html.haml
74
- - app/views/kaminari/_prev_page.html.slim
75
- - config/locales/kaminari.yml
76
- - kaminari-core.gemspec
77
- - lib/generators/kaminari/config_generator.rb
78
- - lib/generators/kaminari/templates/kaminari_config.rb
79
- - lib/generators/kaminari/views_generator.rb
80
- - lib/kaminari/config.rb
81
- - lib/kaminari/core.rb
82
- - lib/kaminari/core/version.rb
83
- - lib/kaminari/engine.rb
84
- - lib/kaminari/exceptions.rb
85
- - lib/kaminari/helpers/helper_methods.rb
86
- - lib/kaminari/helpers/paginator.rb
87
- - lib/kaminari/helpers/tags.rb
88
- - lib/kaminari/models/array_extension.rb
89
- - lib/kaminari/models/configuration_methods.rb
90
- - lib/kaminari/models/page_scope_methods.rb
91
- - lib/kaminari/railtie.rb
92
- homepage: "https://github.com/kaminari/kaminari"
48
+ - CHANGELOG.md
49
+ - MIT-LICENSE
50
+ - README.md
51
+ - app/views/kaminari/_first_page.html.erb
52
+ - app/views/kaminari/_first_page.html.haml
53
+ - app/views/kaminari/_first_page.html.slim
54
+ - app/views/kaminari/_gap.html.erb
55
+ - app/views/kaminari/_gap.html.haml
56
+ - app/views/kaminari/_gap.html.slim
57
+ - app/views/kaminari/_last_page.html.erb
58
+ - app/views/kaminari/_last_page.html.haml
59
+ - app/views/kaminari/_last_page.html.slim
60
+ - app/views/kaminari/_next_page.html.erb
61
+ - app/views/kaminari/_next_page.html.haml
62
+ - app/views/kaminari/_next_page.html.slim
63
+ - app/views/kaminari/_page.html.erb
64
+ - app/views/kaminari/_page.html.haml
65
+ - app/views/kaminari/_page.html.slim
66
+ - app/views/kaminari/_paginator.html.erb
67
+ - app/views/kaminari/_paginator.html.haml
68
+ - app/views/kaminari/_paginator.html.slim
69
+ - app/views/kaminari/_prev_page.html.erb
70
+ - app/views/kaminari/_prev_page.html.haml
71
+ - app/views/kaminari/_prev_page.html.slim
72
+ - config/locales/kaminari.yml
73
+ - kaminari-core.gemspec
74
+ - lib/generators/kaminari/config_generator.rb
75
+ - lib/generators/kaminari/templates/kaminari_config.rb
76
+ - lib/generators/kaminari/views_generator.rb
77
+ - lib/kaminari/config.rb
78
+ - lib/kaminari/core.rb
79
+ - lib/kaminari/core/version.rb
80
+ - lib/kaminari/engine.rb
81
+ - lib/kaminari/exceptions.rb
82
+ - lib/kaminari/helpers/helper_methods.rb
83
+ - lib/kaminari/helpers/paginator.rb
84
+ - lib/kaminari/helpers/tags.rb
85
+ - lib/kaminari/models/array_extension.rb
86
+ - lib/kaminari/models/configuration_methods.rb
87
+ - lib/kaminari/models/page_scope_methods.rb
88
+ - lib/kaminari/railtie.rb
89
+ homepage: https://github.com/kaminari/kaminari
93
90
  licenses:
94
- - MIT
91
+ - MIT
95
92
  metadata:
96
- changelog_uri: "https://github.com/kaminari/kaminari/blob/master/CHANGELOG.md"
97
- source_code_uri: "https://github.com/kaminari/kaminari/tree/master/kaminari-core"
98
- rubygems_mfa_required: "true"
93
+ changelog_uri: https://github.com/kaminari/kaminari/blob/master/CHANGELOG.md
94
+ source_code_uri: https://github.com/kaminari/kaminari/tree/master/kaminari-core
95
+ rubygems_mfa_required: 'true'
99
96
  rdoc_options: []
100
97
  require_paths:
101
- - lib
98
+ - lib
102
99
  required_ruby_version: !ruby/object:Gem::Requirement
103
100
  requirements:
104
- -
105
- - ">="
106
- - !ruby/object:Gem::Version
107
- version: 2.0.0
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: 2.0.0
108
104
  required_rubygems_version: !ruby/object:Gem::Requirement
109
105
  requirements:
110
- -
111
- - ">="
112
- - !ruby/object:Gem::Version
113
- version: "0"
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
114
109
  requirements: []
115
- rubygems_version: 4.1.0.beta2
110
+ rubygems_version: 4.0.20
116
111
  specification_version: 4
117
112
  summary: Kaminari's core pagination library
118
113
  test_files: []