kaminari 0.14.1 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kaminari might be problematic. Click here for more details.

Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.document +1 -4
  4. data/.gitignore +1 -0
  5. data/.travis.yml +23 -5
  6. data/CHANGELOG +33 -0
  7. data/Gemfile +1 -1
  8. data/README.rdoc +40 -22
  9. data/Rakefile +2 -2
  10. data/app/views/kaminari/_first_page.html.erb +1 -1
  11. data/app/views/kaminari/_first_page.html.haml +1 -1
  12. data/app/views/kaminari/_first_page.html.slim +1 -1
  13. data/app/views/kaminari/_gap.html.erb +1 -1
  14. data/app/views/kaminari/_gap.html.haml +1 -1
  15. data/app/views/kaminari/_gap.html.slim +1 -1
  16. data/app/views/kaminari/_last_page.html.erb +1 -1
  17. data/app/views/kaminari/_last_page.html.haml +1 -1
  18. data/app/views/kaminari/_last_page.html.slim +1 -1
  19. data/app/views/kaminari/_next_page.html.erb +1 -1
  20. data/app/views/kaminari/_next_page.html.haml +1 -1
  21. data/app/views/kaminari/_next_page.html.slim +1 -1
  22. data/app/views/kaminari/_prev_page.html.erb +1 -1
  23. data/app/views/kaminari/_prev_page.html.haml +1 -1
  24. data/app/views/kaminari/_prev_page.html.slim +1 -1
  25. data/gemfiles/active_record_30.gemfile +5 -3
  26. data/gemfiles/active_record_31.gemfile +3 -3
  27. data/gemfiles/active_record_32.gemfile +6 -3
  28. data/gemfiles/active_record_40.gemfile +7 -0
  29. data/gemfiles/active_record_edge.gemfile +11 -0
  30. data/gemfiles/data_mapper_12.gemfile +10 -7
  31. data/gemfiles/mongo_mapper.gemfile +4 -1
  32. data/gemfiles/mongoid_24.gemfile +1 -1
  33. data/gemfiles/mongoid_30.gemfile +7 -2
  34. data/gemfiles/mongoid_31.gemfile +12 -0
  35. data/gemfiles/sinatra_13.gemfile +15 -0
  36. data/gemfiles/sinatra_14.gemfile +15 -0
  37. data/kaminari.gemspec +4 -4
  38. data/lib/kaminari/config.rb +2 -0
  39. data/lib/kaminari/helpers/action_view_extension.rb +1 -2
  40. data/lib/kaminari/helpers/paginator.rb +23 -12
  41. data/lib/kaminari/helpers/sinatra_helpers.rb +7 -1
  42. data/lib/kaminari/helpers/tags.rb +1 -1
  43. data/lib/kaminari/models/active_record_model_extension.rb +7 -5
  44. data/lib/kaminari/models/active_record_relation_methods.rb +12 -10
  45. data/lib/kaminari/models/array_extension.rb +4 -6
  46. data/lib/kaminari/models/configuration_methods.rb +16 -2
  47. data/lib/kaminari/models/data_mapper_extension.rb +5 -2
  48. data/lib/kaminari/models/page_scope_methods.rb +32 -3
  49. data/lib/kaminari/models/plucky_criteria_methods.rb +2 -1
  50. data/lib/kaminari/version.rb +1 -1
  51. data/lib/kaminari.rb +5 -4
  52. data/spec/config/config_spec.rb +15 -0
  53. data/spec/fake_app/active_record/models.rb +8 -0
  54. data/spec/fake_app/rails_app.rb +1 -0
  55. data/spec/helpers/action_view_extension_spec.rb +2 -2
  56. data/spec/models/active_record/active_record_relation_methods_spec.rb +42 -1
  57. data/spec/models/active_record/scopes_spec.rb +79 -2
  58. data/spec/models/array_spec.rb +29 -0
  59. data/spec/models/configuration_methods_spec.rb +125 -0
  60. data/spec/models/data_mapper/data_mapper_spec.rb +52 -0
  61. data/spec/models/mongo_mapper/mongo_mapper_spec.rb +12 -0
  62. data/spec/models/mongoid/mongoid_spec.rb +16 -0
  63. data/spec/spec_helper.rb +1 -0
  64. data/spec/spec_helper_for_sinatra.rb +2 -3
  65. data/spec/support/database_cleaner.rb +5 -2
  66. metadata +50 -73
  67. data/gemfiles/sinatra.gemfile +0 -10
  68. data/spec/models/active_record/default_per_page_spec.rb +0 -32
  69. data/spec/models/active_record/max_per_page_spec.rb +0 -32
metadata CHANGED
@@ -1,194 +1,174 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaminari
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
5
- prerelease:
4
+ version: 0.15.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Akira Matsuda
8
+ - Zachary Scott
9
+ - Yuki Nishijima
10
+ - Hiroshi Shibata
9
11
  autorequire:
10
12
  bindir: bin
11
13
  cert_chain: []
12
- date: 2012-09-11 00:00:00.000000000 Z
14
+ date: 2013-11-22 00:00:00.000000000 Z
13
15
  dependencies:
14
16
  - !ruby/object:Gem::Dependency
15
17
  name: activesupport
16
18
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
19
  requirements:
19
- - - ! '>='
20
+ - - ">="
20
21
  - !ruby/object:Gem::Version
21
22
  version: 3.0.0
22
23
  type: :runtime
23
24
  prerelease: false
24
25
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.0.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: actionpack
32
32
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
33
  requirements:
35
- - - ! '>='
34
+ - - ">="
36
35
  - !ruby/object:Gem::Version
37
36
  version: 3.0.0
38
37
  type: :runtime
39
38
  prerelease: false
40
39
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
40
  requirements:
43
- - - ! '>='
41
+ - - ">="
44
42
  - !ruby/object:Gem::Version
45
43
  version: 3.0.0
46
44
  - !ruby/object:Gem::Dependency
47
45
  name: bundler
48
46
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
47
  requirements:
51
- - - ! '>='
48
+ - - ">="
52
49
  - !ruby/object:Gem::Version
53
50
  version: 1.0.0
54
51
  type: :development
55
52
  prerelease: false
56
53
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
54
  requirements:
59
- - - ! '>='
55
+ - - ">="
60
56
  - !ruby/object:Gem::Version
61
57
  version: 1.0.0
62
58
  - !ruby/object:Gem::Dependency
63
59
  name: rake
64
60
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
61
  requirements:
67
- - - ! '>='
62
+ - - ">="
68
63
  - !ruby/object:Gem::Version
69
64
  version: '0'
70
65
  type: :development
71
66
  prerelease: false
72
67
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
68
  requirements:
75
- - - ! '>='
69
+ - - ">="
76
70
  - !ruby/object:Gem::Version
77
71
  version: '0'
78
72
  - !ruby/object:Gem::Dependency
79
73
  name: sqlite3
80
74
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
75
  requirements:
83
- - - ! '>='
76
+ - - ">="
84
77
  - !ruby/object:Gem::Version
85
78
  version: '0'
86
79
  type: :development
87
80
  prerelease: false
88
81
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
82
  requirements:
91
- - - ! '>='
83
+ - - ">="
92
84
  - !ruby/object:Gem::Version
93
85
  version: '0'
94
86
  - !ruby/object:Gem::Dependency
95
87
  name: tzinfo
96
88
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
89
  requirements:
99
- - - ! '>='
90
+ - - ">="
100
91
  - !ruby/object:Gem::Version
101
92
  version: '0'
102
93
  type: :development
103
94
  prerelease: false
104
95
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
96
  requirements:
107
- - - ! '>='
97
+ - - ">="
108
98
  - !ruby/object:Gem::Version
109
99
  version: '0'
110
100
  - !ruby/object:Gem::Dependency
111
101
  name: rspec
112
102
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
103
  requirements:
115
- - - ! '>='
104
+ - - ">="
116
105
  - !ruby/object:Gem::Version
117
106
  version: '0'
118
107
  type: :development
119
108
  prerelease: false
120
109
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
110
  requirements:
123
- - - ! '>='
111
+ - - ">="
124
112
  - !ruby/object:Gem::Version
125
113
  version: '0'
126
114
  - !ruby/object:Gem::Dependency
127
115
  name: rr
128
116
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
117
  requirements:
131
- - - ! '>='
118
+ - - ">="
132
119
  - !ruby/object:Gem::Version
133
120
  version: '0'
134
121
  type: :development
135
122
  prerelease: false
136
123
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
124
  requirements:
139
- - - ! '>='
125
+ - - ">="
140
126
  - !ruby/object:Gem::Version
141
127
  version: '0'
142
128
  - !ruby/object:Gem::Dependency
143
129
  name: capybara
144
130
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
131
  requirements:
147
- - - ! '>='
132
+ - - ">="
148
133
  - !ruby/object:Gem::Version
149
134
  version: '1.0'
150
135
  type: :development
151
136
  prerelease: false
152
137
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
138
  requirements:
155
- - - ! '>='
139
+ - - ">="
156
140
  - !ruby/object:Gem::Version
157
141
  version: '1.0'
158
142
  - !ruby/object:Gem::Dependency
159
143
  name: database_cleaner
160
144
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
145
  requirements:
163
- - - ! '>='
146
+ - - "~>"
164
147
  - !ruby/object:Gem::Version
165
- version: '0'
148
+ version: 1.2.0
166
149
  type: :development
167
150
  prerelease: false
168
151
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
152
  requirements:
171
- - - ! '>='
153
+ - - "~>"
172
154
  - !ruby/object:Gem::Version
173
- version: '0'
155
+ version: 1.2.0
174
156
  - !ruby/object:Gem::Dependency
175
157
  name: rdoc
176
158
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
159
  requirements:
179
- - - ! '>='
160
+ - - ">="
180
161
  - !ruby/object:Gem::Version
181
162
  version: '0'
182
163
  type: :development
183
164
  prerelease: false
184
165
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
166
  requirements:
187
- - - ! '>='
167
+ - - ">="
188
168
  - !ruby/object:Gem::Version
189
169
  version: '0'
190
170
  description: Kaminari is a Scope & Engine based, clean, powerful, agnostic, customizable
191
- and sophisticated paginator for Rails 3
171
+ and sophisticated paginator for Rails 3+
192
172
  email:
193
173
  - ronnie@dio.jp
194
174
  executables: []
@@ -196,11 +176,12 @@ extensions: []
196
176
  extra_rdoc_files:
197
177
  - README.rdoc
198
178
  files:
199
- - .document
200
- - .gemtest
201
- - .gitignore
202
- - .rspec
203
- - .travis.yml
179
+ - ".coveralls.yml"
180
+ - ".document"
181
+ - ".gemtest"
182
+ - ".gitignore"
183
+ - ".rspec"
184
+ - ".travis.yml"
204
185
  - CHANGELOG
205
186
  - Gemfile
206
187
  - MIT-LICENSE
@@ -231,11 +212,15 @@ files:
231
212
  - gemfiles/active_record_30.gemfile
232
213
  - gemfiles/active_record_31.gemfile
233
214
  - gemfiles/active_record_32.gemfile
215
+ - gemfiles/active_record_40.gemfile
216
+ - gemfiles/active_record_edge.gemfile
234
217
  - gemfiles/data_mapper_12.gemfile
235
218
  - gemfiles/mongo_mapper.gemfile
236
219
  - gemfiles/mongoid_24.gemfile
237
220
  - gemfiles/mongoid_30.gemfile
238
- - gemfiles/sinatra.gemfile
221
+ - gemfiles/mongoid_31.gemfile
222
+ - gemfiles/sinatra_13.gemfile
223
+ - gemfiles/sinatra_14.gemfile
239
224
  - kaminari.gemspec
240
225
  - lib/generators/kaminari/config_generator.rb
241
226
  - lib/generators/kaminari/templates/kaminari_config.rb
@@ -281,10 +266,9 @@ files:
281
266
  - spec/helpers/sinatra_helpers_spec.rb
282
267
  - spec/helpers/tags_spec.rb
283
268
  - spec/models/active_record/active_record_relation_methods_spec.rb
284
- - spec/models/active_record/default_per_page_spec.rb
285
- - spec/models/active_record/max_per_page_spec.rb
286
269
  - spec/models/active_record/scopes_spec.rb
287
270
  - spec/models/array_spec.rb
271
+ - spec/models/configuration_methods_spec.rb
288
272
  - spec/models/data_mapper/data_mapper_spec.rb
289
273
  - spec/models/mongo_mapper/mongo_mapper_spec.rb
290
274
  - spec/models/mongoid/mongoid_spec.rb
@@ -296,34 +280,27 @@ files:
296
280
  homepage: https://github.com/amatsuda/kaminari
297
281
  licenses:
298
282
  - MIT
283
+ metadata: {}
299
284
  post_install_message:
300
285
  rdoc_options: []
301
286
  require_paths:
302
287
  - lib
303
288
  required_ruby_version: !ruby/object:Gem::Requirement
304
- none: false
305
289
  requirements:
306
- - - ! '>='
290
+ - - ">="
307
291
  - !ruby/object:Gem::Version
308
292
  version: '0'
309
- segments:
310
- - 0
311
- hash: -1633849575199426851
312
293
  required_rubygems_version: !ruby/object:Gem::Requirement
313
- none: false
314
294
  requirements:
315
- - - ! '>='
295
+ - - ">="
316
296
  - !ruby/object:Gem::Version
317
297
  version: '0'
318
- segments:
319
- - 0
320
- hash: -1633849575199426851
321
298
  requirements: []
322
299
  rubyforge_project: kaminari
323
- rubygems_version: 1.8.24
300
+ rubygems_version: 2.2.0
324
301
  signing_key:
325
- specification_version: 3
326
- summary: A pagination engine plugin for Rails 3 or other modern frameworks
302
+ specification_version: 4
303
+ summary: A pagination engine plugin for Rails 3+ or other modern frameworks
327
304
  test_files:
328
305
  - spec/config/config_spec.rb
329
306
  - spec/fake_app/active_record/config.rb
@@ -342,10 +319,9 @@ test_files:
342
319
  - spec/helpers/sinatra_helpers_spec.rb
343
320
  - spec/helpers/tags_spec.rb
344
321
  - spec/models/active_record/active_record_relation_methods_spec.rb
345
- - spec/models/active_record/default_per_page_spec.rb
346
- - spec/models/active_record/max_per_page_spec.rb
347
322
  - spec/models/active_record/scopes_spec.rb
348
323
  - spec/models/array_spec.rb
324
+ - spec/models/configuration_methods_spec.rb
349
325
  - spec/models/data_mapper/data_mapper_spec.rb
350
326
  - spec/models/mongo_mapper/mongo_mapper_spec.rb
351
327
  - spec/models/mongoid/mongoid_spec.rb
@@ -354,3 +330,4 @@ test_files:
354
330
  - spec/spec_helper_for_sinatra.rb
355
331
  - spec/support/database_cleaner.rb
356
332
  - spec/support/matchers.rb
333
+ has_rdoc:
@@ -1,10 +0,0 @@
1
- source :rubygems
2
-
3
- gem 'activerecord', '>= 3.2.3', :require => 'active_record'
4
- gem 'sinatra', '>= 1.3'
5
- gem 'padrino-helpers', '>= 0.10.6.c'
6
- gem 'rack-test', '>= 0'
7
- gem 'sinatra-contrib', '>= 1.3'
8
- gem 'nokogiri', '>= 0'
9
-
10
- gemspec :path => '../'
@@ -1,32 +0,0 @@
1
- require 'spec_helper'
2
-
3
- if defined? ActiveRecord
4
-
5
- describe 'default per_page' do
6
- describe 'AR::Base' do
7
- subject { ActiveRecord::Base }
8
- it { should_not respond_to :paginates_per }
9
- end
10
-
11
- subject { User.page 0 }
12
-
13
- context 'by default' do
14
- its(:limit_value) { should == 25 }
15
- end
16
-
17
- context 'when explicitly set via paginates_per' do
18
- before { User.paginates_per 1326 }
19
- its(:limit_value) { should == 1326 }
20
- after { User.paginates_per nil }
21
- end
22
-
23
- describe "default per_page value's independency per model" do
24
- context "when User's default per_page was changed" do
25
- before { User.paginates_per 1326 }
26
- subject { Book.page 0 }
27
- its(:limit_value) { should == 25 }
28
- after { User.paginates_per nil }
29
- end
30
- end
31
- end
32
- end
@@ -1,32 +0,0 @@
1
- require 'spec_helper'
2
-
3
- if defined? ActiveRecord
4
-
5
- describe 'max per_page' do
6
- describe 'AR::Base' do
7
- subject { ActiveRecord::Base }
8
- it { should_not respond_to :max_paginates_per }
9
- end
10
-
11
- subject { User.page(0).per(100) }
12
-
13
- context 'by default' do
14
- its(:limit_value) { should == 100 }
15
- end
16
-
17
- context 'when explicitly set via max_paginates_per' do
18
- before { User.max_paginates_per 10 }
19
- its(:limit_value) { should == 10 }
20
- after { User.max_paginates_per nil }
21
- end
22
-
23
- describe "max per_page value's independency per model" do
24
- context "when User's max per_page was changed" do
25
- before { User.max_paginates_per 10 }
26
- subject { Book.page(0).per(100) }
27
- its(:limit_value) { should == 100 }
28
- after { User.max_paginates_per nil }
29
- end
30
- end
31
- end
32
- end