kaminari 1.0.1 → 1.1.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.
- checksums.yaml +5 -5
- data/.codeclimate.yml +19 -0
- data/.gitignore +1 -0
- data/.travis.yml +29 -21
- data/CHANGELOG.md +15 -0
- data/README.md +16 -3
- data/Rakefile +2 -0
- data/gemfiles/active_record_41.gemfile +7 -3
- data/gemfiles/active_record_42.gemfile +7 -3
- data/gemfiles/active_record_50.gemfile +6 -2
- data/gemfiles/active_record_51.gemfile +24 -0
- data/gemfiles/active_record_edge.gemfile +6 -2
- data/lib/kaminari/version.rb +1 -1
- data/misc/bug_report_template.rb +2 -2
- metadata +11 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e327d193e7503f8605000e9f9b50d8a49ad1b5891db7b63f2a2b52e17570f3f0
|
4
|
+
data.tar.gz: 83d6e7245420c50fd8678fdefbe4ba923df61d3b85c0b7439e1c55880e09c5bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3192413803fb8dcd518b0412ebd3d0d008692f4ced0576f1c5887ed36d5b45d0c067a029187b0be84fc701fcbf3240a72c90431f8bdf5dc363d85dda5e340980
|
7
|
+
data.tar.gz: '018fa6b74c07c7e77ef824b53354818305fe096d6aeaaecf0a76d28df3953b9d8b4ad287ecc96142efc33746b1d8beb8ed844722173510671e4c053a99c99c46'
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
engines:
|
3
|
+
duplication:
|
4
|
+
enabled: true
|
5
|
+
config:
|
6
|
+
languages:
|
7
|
+
- ruby
|
8
|
+
fixme:
|
9
|
+
enabled: true
|
10
|
+
rubocop:
|
11
|
+
enabled: true
|
12
|
+
ratings:
|
13
|
+
paths:
|
14
|
+
- "**.rb"
|
15
|
+
exclude_paths:
|
16
|
+
- test/
|
17
|
+
- "*/test/"
|
18
|
+
- "**/*.gemspec"
|
19
|
+
- "**/*.md"
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,48 +1,56 @@
|
|
1
1
|
language: ruby
|
2
|
-
dist: trusty
|
3
2
|
|
4
3
|
rvm:
|
5
|
-
- 2.4.
|
6
|
-
- 2.3.
|
7
|
-
- 2.2.6
|
8
|
-
- 2.1.10
|
9
|
-
- 2.0.0
|
4
|
+
- 2.4.2
|
5
|
+
- 2.3.5
|
10
6
|
- ruby-head
|
11
|
-
- jruby-9.1.
|
12
|
-
- rbx-3
|
7
|
+
- jruby-9.1.13.0
|
8
|
+
# - rbx-3
|
13
9
|
|
14
10
|
gemfile:
|
11
|
+
- gemfiles/active_record_51.gemfile
|
15
12
|
- gemfiles/active_record_50.gemfile
|
16
13
|
- gemfiles/active_record_42.gemfile
|
17
14
|
- gemfiles/active_record_41.gemfile
|
18
15
|
- gemfiles/active_record_edge.gemfile
|
19
16
|
|
17
|
+
env:
|
18
|
+
- DB=sqlite3
|
19
|
+
- DB=postgresql
|
20
|
+
- DB=mysql
|
21
|
+
|
20
22
|
sudo: false
|
21
23
|
|
22
|
-
before_install:
|
24
|
+
before_install:
|
25
|
+
- gem update --system
|
26
|
+
- gem update bundler --no-document
|
23
27
|
script: 'bundle exec rake test'
|
24
28
|
|
25
29
|
cache: bundler
|
26
30
|
|
27
31
|
matrix:
|
28
32
|
exclude:
|
29
|
-
- rvm: 2.
|
30
|
-
gemfile: gemfiles/
|
31
|
-
- rvm: 2.
|
32
|
-
gemfile: gemfiles/active_record_50.gemfile
|
33
|
-
- rvm: 2.0.0
|
34
|
-
gemfile: gemfiles/active_record_edge.gemfile
|
35
|
-
- rvm: 2.1.10
|
36
|
-
gemfile: gemfiles/active_record_edge.gemfile
|
37
|
-
- rvm: 2.4.0
|
33
|
+
- rvm: 2.4.2
|
34
|
+
gemfile: gemfiles/active_record_42.gemfile
|
35
|
+
- rvm: 2.4.2
|
38
36
|
gemfile: gemfiles/active_record_41.gemfile
|
39
|
-
- rvm:
|
37
|
+
- rvm: ruby-head
|
40
38
|
gemfile: gemfiles/active_record_42.gemfile
|
41
39
|
- rvm: ruby-head
|
42
40
|
gemfile: gemfiles/active_record_41.gemfile
|
41
|
+
include:
|
42
|
+
- rvm: 2.2.8
|
43
|
+
gemfile: gemfiles/active_record_51.gemfile
|
44
|
+
env: DB=sqlite3
|
45
|
+
- rvm: 2.1.10
|
46
|
+
gemfile: gemfiles/active_record_42.gemfile
|
47
|
+
env: DB=sqlite3
|
48
|
+
- rvm: 2.0.0
|
49
|
+
gemfile: gemfiles/active_record_42.gemfile
|
50
|
+
env: DB=sqlite3
|
43
51
|
allow_failures:
|
44
52
|
- rvm: ruby-head
|
45
|
-
- rvm: jruby-9.1.
|
46
|
-
- rvm: rbx-3
|
53
|
+
- rvm: jruby-9.1.13.0
|
54
|
+
# - rvm: rbx-3
|
47
55
|
- gemfile: gemfiles/active_record_edge.gemfile
|
48
56
|
fast_finish: true
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## 1.1.0
|
2
|
+
|
3
|
+
### Enhancements:
|
4
|
+
|
5
|
+
* Now the `page_entries_info` method respects the `I18n.locale` value when pluralizing the `entry_name` option #899 [@hundred]
|
6
|
+
* `require 'kaminari/core'` is no longer necessary when using `require 'kaminari/activerecord'` #896 [@yhara]
|
7
|
+
* Added the `#current_per_page` method to inspect current value of `per_page` #875 [#bfad]
|
8
|
+
* Better accesibility support by adding accessibility roles to pagination nav #848 [@frrrances]
|
9
|
+
|
10
|
+
### Bug Fixes:
|
11
|
+
|
12
|
+
* Fixed an issue where the command `rails g kaminari:views ...` stopped working due to a missing require #912 [@jvsoares]
|
13
|
+
* Fixed a bug where passing in `params` to the `link_to_next_page` or `link_to_previous_page` method raises an exception #874 [@5t111111]
|
14
|
+
|
15
|
+
|
1
16
|
## 1.0.1
|
2
17
|
|
3
18
|
### Bug Fixes:
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Kaminari [![Build Status](https://travis-ci.org/kaminari/kaminari.svg)](http://travis-ci.org/kaminari/kaminari) [![Code Climate](https://
|
1
|
+
# Kaminari [![Build Status](https://travis-ci.org/kaminari/kaminari.svg)](http://travis-ci.org/kaminari/kaminari) [![Code Climate](https://codeclimate.com/github/kaminari/kaminari/badges/gpa.svg)](https://codeclimate.com/github/kaminari/kaminari) [![Inch CI](http://inch-ci.org/github/kaminari/kaminari.svg)](http://inch-ci.org/github/kaminari/kaminari)
|
2
2
|
|
3
3
|
A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for modern web app frameworks and ORMs
|
4
4
|
|
@@ -32,7 +32,7 @@ The pagination helper outputs the HTML5 `<nav>` tag by default. Plus, the helper
|
|
32
32
|
|
33
33
|
* Ruby 2.0.0, 2.1.x, 2.2.x, 2.3.x, 2.4.x, 2.5
|
34
34
|
|
35
|
-
* Rails 4.1, 4.2, 5.0, 5.1
|
35
|
+
* Rails 4.1, 4.2, 5.0, 5.1, 5.2
|
36
36
|
|
37
37
|
* Sinatra 1.4
|
38
38
|
|
@@ -74,6 +74,19 @@ User.page(7)
|
|
74
74
|
|
75
75
|
Note: pagination starts at page 1, not at page 0 (page(0) will return the same results as page(1)).
|
76
76
|
|
77
|
+
You can get page numbers or page conditions by using below methods.
|
78
|
+
```ruby
|
79
|
+
User.count #=> 1000
|
80
|
+
User.page(1).limit_value #=> 20
|
81
|
+
User.page(1).total_pages #=> 50
|
82
|
+
User.page(1).current_page #=> 1
|
83
|
+
User.page(1).next_page #=> 2
|
84
|
+
User.page(2).prev_page #=> 1
|
85
|
+
User.page(1).first_page? #=> true
|
86
|
+
User.page(50).last_page? #=> true
|
87
|
+
User.page(100).out_of_range? #=> true
|
88
|
+
```
|
89
|
+
|
77
90
|
### The `per` Scope
|
78
91
|
|
79
92
|
To show a lot more users per each page (change the `per_page` value)
|
@@ -207,7 +220,7 @@ page.
|
|
207
220
|
<%= paginate @users, outer_window: 3 %>
|
208
221
|
```
|
209
222
|
|
210
|
-
This would output something like `1 2 3
|
223
|
+
This would output something like `1 2 3 ...(snip)... 18 19 20` while having 20 pages in total.
|
211
224
|
|
212
225
|
### Outer Window Can Be Separately Specified by left, right (0 by default)
|
213
226
|
|
data/Rakefile
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
require "bundler/gem_tasks"
|
5
5
|
|
6
6
|
require 'rake/testtask'
|
7
|
+
require 'kaminari'
|
7
8
|
|
8
9
|
Rake::TestTask.new do |t|
|
9
10
|
t.libs << 'test'
|
@@ -17,6 +18,7 @@ task default: "test:all"
|
|
17
18
|
namespace :test do
|
18
19
|
mappers = %w(
|
19
20
|
active_record_edge
|
21
|
+
active_record_51
|
20
22
|
active_record_50
|
21
23
|
active_record_42
|
22
24
|
active_record_41
|
@@ -5,14 +5,18 @@ gem 'activerecord', '~> 4.1.0', require: 'active_record'
|
|
5
5
|
|
6
6
|
platforms :ruby do
|
7
7
|
if RUBY_VERSION > "2.1.0"
|
8
|
-
gem 'sqlite3'
|
8
|
+
gem 'sqlite3', require: false
|
9
9
|
else
|
10
|
-
gem 'sqlite3', '1.3.8'
|
10
|
+
gem 'sqlite3', '1.3.8', require: false
|
11
11
|
gem 'nokogiri', '~> 1.6.8'
|
12
12
|
end
|
13
|
+
gem 'pg', require: false
|
14
|
+
gem 'mysql2', '< 0.4', require: false
|
13
15
|
end
|
14
16
|
platforms :jruby do
|
15
|
-
gem 'activerecord-jdbcsqlite3-adapter',
|
17
|
+
gem 'activerecord-jdbcsqlite3-adapter', require: false
|
18
|
+
gem 'activerecord-jdbcpostgresql-adapter', require: false
|
19
|
+
gem 'activerecord-jdbcmysql-adapter', require: false
|
16
20
|
end
|
17
21
|
platforms :rbx do
|
18
22
|
gem 'rubysl', '~> 2.0'
|
@@ -5,14 +5,18 @@ gem 'activerecord', '~> 4.2.0', require: 'active_record'
|
|
5
5
|
|
6
6
|
platforms :ruby do
|
7
7
|
if RUBY_VERSION > "2.1.0"
|
8
|
-
gem 'sqlite3'
|
8
|
+
gem 'sqlite3', require: false
|
9
9
|
else
|
10
|
-
gem 'sqlite3', '1.3.8'
|
10
|
+
gem 'sqlite3', '1.3.8', require: false
|
11
11
|
gem 'nokogiri', '~> 1.6.8'
|
12
12
|
end
|
13
|
+
gem 'pg', require: false
|
14
|
+
gem 'mysql2', require: false
|
13
15
|
end
|
14
16
|
platforms :jruby do
|
15
|
-
gem 'activerecord-jdbcsqlite3-adapter',
|
17
|
+
gem 'activerecord-jdbcsqlite3-adapter', require: false
|
18
|
+
gem 'activerecord-jdbcpostgresql-adapter', require: false
|
19
|
+
gem 'activerecord-jdbcmysql-adapter', require: false
|
16
20
|
end
|
17
21
|
platforms :rbx do
|
18
22
|
gem 'rubysl', '~> 2.0'
|
@@ -5,10 +5,14 @@ gem 'activerecord', '~> 5.0.0', require: 'active_record'
|
|
5
5
|
gem 'actionview', '~> 5.0.0', require: 'action_view'
|
6
6
|
|
7
7
|
platforms :ruby do
|
8
|
-
gem 'sqlite3'
|
8
|
+
gem 'sqlite3', require: false
|
9
|
+
gem 'pg', require: false
|
10
|
+
gem 'mysql2', require: false
|
9
11
|
end
|
10
12
|
platforms :jruby do
|
11
|
-
gem 'activerecord-jdbcsqlite3-adapter',
|
13
|
+
gem 'activerecord-jdbcsqlite3-adapter', require: false
|
14
|
+
gem 'activerecord-jdbcpostgresql-adapter', require: false
|
15
|
+
gem 'activerecord-jdbcmysql-adapter', require: false
|
12
16
|
end
|
13
17
|
platforms :rbx do
|
14
18
|
gem 'rubysl', '~> 2.0'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'railties', '~> 5.1.0'
|
4
|
+
gem 'activerecord', '~> 5.1.0', require: 'active_record'
|
5
|
+
gem 'actionview', '~> 5.1.0', require: 'action_view'
|
6
|
+
|
7
|
+
platforms :ruby do
|
8
|
+
gem 'sqlite3', require: false
|
9
|
+
gem 'pg', require: false
|
10
|
+
gem 'mysql2', require: false
|
11
|
+
end
|
12
|
+
platforms :jruby do
|
13
|
+
gem 'activerecord-jdbcsqlite3-adapter', require: false
|
14
|
+
gem 'activerecord-jdbcpostgresql-adapter', require: false
|
15
|
+
gem 'activerecord-jdbcmysql-adapter', require: false
|
16
|
+
end
|
17
|
+
platforms :rbx do
|
18
|
+
gem 'rubysl', '~> 2.0'
|
19
|
+
gem 'racc'
|
20
|
+
gem 'minitest'
|
21
|
+
gem 'rubinius-developer_tools'
|
22
|
+
end
|
23
|
+
|
24
|
+
gemspec path: '../'
|
@@ -16,13 +16,17 @@ gem 'arel', github: 'rails/arel'
|
|
16
16
|
|
17
17
|
platforms :ruby do
|
18
18
|
if RUBY_VERSION > "2.1.0"
|
19
|
-
gem 'sqlite3'
|
19
|
+
gem 'sqlite3', require: false
|
20
20
|
else
|
21
|
-
gem 'sqlite3', '1.3.8'
|
21
|
+
gem 'sqlite3', '1.3.8', require: false
|
22
22
|
end
|
23
|
+
gem 'pg', require: false
|
24
|
+
gem 'mysql2', require: false
|
23
25
|
end
|
24
26
|
platforms :jruby do
|
25
27
|
gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0'
|
28
|
+
gem 'activerecord-jdbcpostgresql-adapter', require: false
|
29
|
+
gem 'activerecord-jdbcmysql-adapter', require: false
|
26
30
|
end
|
27
31
|
platforms :rbx do
|
28
32
|
gem 'rubysl', '~> 2.0'
|
data/lib/kaminari/version.rb
CHANGED
data/misc/bug_report_template.rb
CHANGED
@@ -11,8 +11,8 @@ gemfile(true) do
|
|
11
11
|
gem "railties", "5.0.1"
|
12
12
|
gem "activerecord", "5.0.1"
|
13
13
|
gem "sqlite3"
|
14
|
-
gem "kaminari-core", "1.0.
|
15
|
-
gem "kaminari-activerecord", "1.0.
|
14
|
+
gem "kaminari-core", "1.0.1"
|
15
|
+
gem "kaminari-activerecord", "1.0.1"
|
16
16
|
end
|
17
17
|
|
18
18
|
require "active_record"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kaminari
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-
|
14
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -33,42 +33,42 @@ dependencies:
|
|
33
33
|
requirements:
|
34
34
|
- - '='
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 1.0
|
36
|
+
version: 1.1.0
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - '='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.0
|
43
|
+
version: 1.1.0
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: kaminari-actionview
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
48
|
- - '='
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 1.0
|
50
|
+
version: 1.1.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - '='
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 1.0
|
57
|
+
version: 1.1.0
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: kaminari-activerecord
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - '='
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.0
|
64
|
+
version: 1.1.0
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - '='
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 1.0
|
71
|
+
version: 1.1.0
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: test-unit-rails
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,6 +147,7 @@ executables: []
|
|
147
147
|
extensions: []
|
148
148
|
extra_rdoc_files: []
|
149
149
|
files:
|
150
|
+
- ".codeclimate.yml"
|
150
151
|
- ".document"
|
151
152
|
- ".gitignore"
|
152
153
|
- ".travis.yml"
|
@@ -159,6 +160,7 @@ files:
|
|
159
160
|
- gemfiles/active_record_41.gemfile
|
160
161
|
- gemfiles/active_record_42.gemfile
|
161
162
|
- gemfiles/active_record_50.gemfile
|
163
|
+
- gemfiles/active_record_51.gemfile
|
162
164
|
- gemfiles/active_record_edge.gemfile
|
163
165
|
- kaminari.gemspec
|
164
166
|
- lib/kaminari.rb
|
@@ -184,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
186
|
version: '0'
|
185
187
|
requirements: []
|
186
188
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.6.
|
189
|
+
rubygems_version: 2.6.14
|
188
190
|
signing_key:
|
189
191
|
specification_version: 4
|
190
192
|
summary: A pagination engine plugin for Rails 4+ and other modern frameworks
|