kaminari 1.1.1 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79e144bce9eea3099a5710a63f8a359dc57d88d3c48c52be0726d8f7d6b09b6a
4
- data.tar.gz: 41fe275044253ff7e99d514da2acc1a77ea47492483bc1fcfadd521a3d9618b9
3
+ metadata.gz: c8607b285409d76d0c68a19924edf473866ab7a83511c94924349325f0d6b2ca
4
+ data.tar.gz: ac1a08f30feda404a1ce8e86b5a84942b3f18126ae265efb8266133af901a82d
5
5
  SHA512:
6
- metadata.gz: e424967795237e20c69fc7cc7115f9956a24d48e79b4593f47aee25c22b31715801a7b59fc8d82859ccaf2655a4e58dea41878811117adba019d3a03a201d9ff
7
- data.tar.gz: 7e3abbde2657bdbb5898a28513e8e7c6a11ba1ce99792aa1a76a2dab24aff571cca16a1a832690acb389b2898e7dd56da981fe45e40ac63f33d6020c5edc9abe
6
+ metadata.gz: 63878e81aae42b5dbbdefbc99bdf5f9628b2824f0073adb3503a601af79dc7a3dc953a4ed104dbd6ccb88de1cca68c686f1abff8e6dfa4dbe15282ba063b9aa2
7
+ data.tar.gz: 5ee42e101d967dd4f4bbadcb1a57f85f2eff41d25ee64b7aef5da8d77ce03ed7f1297269ae2a45ffa0436535014a086dc4afdbc7332388e5078263854b06bd1c
@@ -1,13 +1,23 @@
1
1
  language: ruby
2
2
 
3
+ dist: xenial
4
+
5
+ services:
6
+ - postgresql
7
+ - mysql
8
+
3
9
  rvm:
4
- - 2.4.2
5
- - 2.3.5
6
- - ruby-head
7
- - jruby-9.1.13.0
10
+ - 2.7.0
11
+ - 2.6.3
12
+ - 2.5.5
13
+ - 2.4.5
14
+ - 2.3.8
15
+ - jruby-9.2.9.0
8
16
  # - rbx-3
9
17
 
10
18
  gemfile:
19
+ - gemfiles/active_record_60.gemfile
20
+ - gemfiles/active_record_52.gemfile
11
21
  - gemfiles/active_record_51.gemfile
12
22
  - gemfiles/active_record_50.gemfile
13
23
  - gemfiles/active_record_42.gemfile
@@ -19,27 +29,59 @@ env:
19
29
  - DB=postgresql
20
30
  - DB=mysql
21
31
 
22
- sudo: false
23
-
24
32
  before_install:
25
- - gem update --system
26
- - gem update bundler --no-document
33
+ # install older versions of rubygems and bundler only on Ruby < 2.7
34
+ - if [ `echo "${TRAVIS_RUBY_VERSION:0:3} < 2.7" | bc` == 1 ]; then gem i rubygems-update -v '<3' && update_rubygems; fi;
35
+ - if [ `echo "${TRAVIS_RUBY_VERSION:0:3} < 2.7" | bc` == 1 ]; then gem i bundler -v '<2'; fi;
27
36
  script: 'bundle exec rake test'
28
37
 
29
38
  cache: bundler
30
39
 
31
40
  matrix:
32
41
  exclude:
33
- - rvm: 2.4.2
42
+ - rvm: 2.7.0
43
+ gemfile: gemfiles/active_record_52.gemfile
44
+ - rvm: 2.7.0
45
+ gemfile: gemfiles/active_record_51.gemfile
46
+ - rvm: 2.7.0
47
+ gemfile: gemfiles/active_record_50.gemfile
48
+ - rvm: 2.7.0
49
+ gemfile: gemfiles/active_record_42.gemfile
50
+ - rvm: 2.7.0
51
+ gemfile: gemfiles/active_record_41.gemfile
52
+ - rvm: 2.6.3
53
+ gemfile: gemfiles/active_record_42.gemfile
54
+ - rvm: 2.6.3
55
+ gemfile: gemfiles/active_record_41.gemfile
56
+ - rvm: 2.5.5
57
+ gemfile: gemfiles/active_record_42.gemfile
58
+ - rvm: 2.5.5
59
+ gemfile: gemfiles/active_record_41.gemfile
60
+ - rvm: 2.4.5
61
+ gemfile: gemfiles/active_record_edge.gemfile
62
+ - rvm: 2.4.5
63
+ gemfile: gemfiles/active_record_60.gemfile
64
+ - rvm: 2.4.5
34
65
  gemfile: gemfiles/active_record_42.gemfile
35
- - rvm: 2.4.2
66
+ - rvm: 2.4.5
36
67
  gemfile: gemfiles/active_record_41.gemfile
68
+ - rvm: 2.3.8
69
+ gemfile: gemfiles/active_record_edge.gemfile
70
+ - rvm: 2.3.8
71
+ gemfile: gemfiles/active_record_60.gemfile
37
72
  - rvm: ruby-head
38
73
  gemfile: gemfiles/active_record_42.gemfile
39
74
  - rvm: ruby-head
40
75
  gemfile: gemfiles/active_record_41.gemfile
76
+ - rvm: jruby-9.2.9.0
77
+ gemfile: gemfiles/active_record_42.gemfile
78
+ - rvm: jruby-9.2.9.0
79
+ gemfile: gemfiles/active_record_41.gemfile
41
80
  include:
42
- - rvm: 2.2.8
81
+ - rvm: ruby-head
82
+ gemfile: gemfiles/active_record_edge.gemfile
83
+ env: DB=sqlite3
84
+ - rvm: 2.2.10
43
85
  gemfile: gemfiles/active_record_51.gemfile
44
86
  env: DB=sqlite3
45
87
  - rvm: 2.1.10
@@ -50,7 +92,7 @@ matrix:
50
92
  env: DB=sqlite3
51
93
  allow_failures:
52
94
  - rvm: ruby-head
53
- - rvm: jruby-9.1.13.0
95
+ - rvm: jruby-9.2.9.0
54
96
  # - rvm: rbx-3
55
97
  - gemfile: gemfiles/active_record_edge.gemfile
56
98
  fast_finish: true
@@ -1,9 +1,31 @@
1
+ ## 1.2.0
2
+
3
+ ### Deprecations:
4
+
5
+ * Deprecated `current_per_page` in favor of `limit_value`
6
+
7
+ ### Enhancements:
8
+
9
+ * Added `#url_to_next_page` and `#url_to_prev_page` helper methods: [38e95a2](https://github.com/kaminari/kaminari/commit/38e95a262a210548c4f892aaa69d09ca8ecdce7f)
10
+ * Extracted url helper methods and packed them in `Kaminari::Helpers::UrlHelper`: [ff38bee](https://github.com/kaminari/kaminari/commit/ff38bee54b5be1a948f1118c0bfd829a72a1a502)
11
+ * Improved performance of `total_count` for grouped queries by explicitly giving SQL `select` clause #979 [@MmKolodziej]
12
+ * Added `LIMIT` to `total_count` query when `max_pages` presents #981 [@rymai]
13
+
14
+ ### Bug Fixes:
15
+
16
+ * Fixed a bug where the `kaminari-mongoid` gem was not loaded properly: kaminari/kaminari-mongoid#9 [@DenniJensen]
17
+ * Fixed a bug where the `#total_count` method incorrectly calculates the total count: #932 [@tumayun]
18
+ * Fixed a bug where `empty?` breaks subsequent `last_page?` in without_count mode #1009 [@montdidier]
19
+ * Fixed kwargs warnings on Ruby 2.7 #1010 [@connorshea]
20
+
21
+
1
22
  ## 1.1.1
2
23
 
3
24
  ### Bug Fixes:
4
25
 
5
26
  * Fixed a bug where `paginate ..., params: { controller: ..., action: ... }` didn't override the `params[:controller]` and `params[:action]` #919 [@chao-mu]
6
27
 
28
+
7
29
  ## 1.1.0
8
30
 
9
31
  ### Enhancements:
@@ -63,6 +85,8 @@
63
85
 
64
86
  * Renamed the model class method for configuring `max_pages` from `max_pages_per` to `max_pages`
65
87
 
88
+ * Raise ZeroPerPageOperation when The number of pages was incalculable of `total_pages`, `current_page` methods
89
+
66
90
  ### Enhancements:
67
91
 
68
92
  * Exposed `path_to_prev_page`, `path_to_next_page` helpers as public API #683 [@neilang]
@@ -11,6 +11,12 @@ __*We only accept bug reports and pull requests in GitHub*__. Join the team!
11
11
  * Feature requests should be accompanied by a patch, that includes tests.
12
12
  * We won't accept any feature requests that come without a patch.
13
13
 
14
+ In addition, we generally don't accept requests that fall within one or more of the following categories:
15
+
16
+ * Requests without any legitimate use cases
17
+ * Requests for which the primary goal is to make a certain piece of code consistent
18
+ * [Cosmetic changes](https://github.com/rails/rails/pull/13771#issuecomment-32746700)
19
+
14
20
  Thanks! :heart: :heart: :heart:
15
21
 
16
22
  Kaminari Team
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  source 'https://rubygems.org'
3
4
 
4
5
  # Specify your gem's dependencies in kaminari.gemspec
data/README.md CHANGED
@@ -30,11 +30,11 @@ The pagination helper outputs the HTML5 `<nav>` tag by default. Plus, the helper
30
30
 
31
31
  ## Supported Versions
32
32
 
33
- * Ruby 2.0.0, 2.1.x, 2.2.x, 2.3.x, 2.4.x, 2.5
33
+ * Ruby 2.0.0, 2.1.x, 2.2.x, 2.3.x, 2.4.x, 2.5.x, 2.6.x, 2.7
34
34
 
35
- * Rails 4.1, 4.2, 5.0, 5.1, 5.2
35
+ * Rails 4.1, 4.2, 5.0, 5.1, 5.2, 6.0
36
36
 
37
- * Sinatra 1.4
37
+ * Sinatra 1.4, 2.0
38
38
 
39
39
  * Haml 3+
40
40
 
@@ -118,6 +118,14 @@ User.page(7).per(50).padding(3)
118
118
 
119
119
  Note that the `padding` scope also is not directly defined on the models.
120
120
 
121
+ ### Unscoping
122
+
123
+ If for some reason you need to unscope `page` and `per` methods you can call `except(:limit, :offset)`
124
+
125
+ ```ruby
126
+ users = User.page(7).per(50)
127
+ unpaged_users = users.except(:limit, :offset) # unpaged_users will not use the kaminari scopes
128
+ ```
121
129
 
122
130
  ## Configuring Kaminari
123
131
 
@@ -441,6 +449,13 @@ You can specify the `total_count` value through options Hash. This would be help
441
449
  @paginatable_array = Kaminari.paginate_array([], total_count: 145).page(params[:page]).per(10)
442
450
  ```
443
451
 
452
+ or, in the case of using an external API to source the page of data:
453
+ ```ruby
454
+ page_size = 10
455
+ one_page = get_page_of_data params[:page], page_size
456
+ @paginatable_array = Kaminari.paginate_array(one_page.data, total_count: one_page.total_count).page(params[:page]).per(page_size)
457
+ ```
458
+
444
459
 
445
460
  ## Creating Friendly URLs and Caching
446
461
 
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  require "bundler/gem_tasks"
@@ -18,6 +17,8 @@ task default: "test:all"
18
17
  namespace :test do
19
18
  mappers = %w(
20
19
  active_record_edge
20
+ active_record_60
21
+ active_record_52
21
22
  active_record_51
22
23
  active_record_50
23
24
  active_record_42
@@ -5,12 +5,12 @@ 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', require: false
8
+ gem 'sqlite3', '~> 1.3.13', require: false
9
9
  else
10
10
  gem 'sqlite3', '1.3.8', require: false
11
11
  gem 'nokogiri', '~> 1.6.8'
12
12
  end
13
- gem 'pg', require: false
13
+ gem 'pg', '< 1.0.0', require: false
14
14
  gem 'mysql2', '< 0.4', require: false
15
15
  end
16
16
  platforms :jruby do
@@ -5,13 +5,13 @@ 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', require: false
8
+ gem 'sqlite3', '~> 1.3.13', require: false
9
9
  else
10
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
+ gem 'pg', '< 1.0.0', require: false
14
+ gem 'mysql2', '< 0.4', require: false
15
15
  end
16
16
  platforms :jruby do
17
17
  gem 'activerecord-jdbcsqlite3-adapter', require: false
@@ -5,8 +5,8 @@ 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', require: false
9
- gem 'pg', require: false
8
+ gem 'sqlite3', '~> 1.3.13', require: false
9
+ gem 'pg', '< 1.0.0', require: false
10
10
  gem 'mysql2', require: false
11
11
  end
12
12
  platforms :jruby do
@@ -5,7 +5,7 @@ gem 'activerecord', '~> 5.1.0', require: 'active_record'
5
5
  gem 'actionview', '~> 5.1.0', require: 'action_view'
6
6
 
7
7
  platforms :ruby do
8
- gem 'sqlite3', require: false
8
+ gem 'sqlite3', '~> 1.3.13', require: false
9
9
  gem 'pg', require: false
10
10
  gem 'mysql2', require: false
11
11
  end
@@ -0,0 +1,24 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'railties', '~> 5.2.0'
4
+ gem 'activerecord', '~> 5.2.0', require: 'active_record'
5
+ gem 'actionview', '~> 5.2.0', require: 'action_view'
6
+
7
+ platforms :ruby do
8
+ gem 'sqlite3', '~> 1.3.13', 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: '../'
@@ -0,0 +1,26 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'railties', '~> 6.0.0'
4
+ gem 'activerecord', '~> 6.0.0', require: 'active_record'
5
+ gem 'actionview', '~> 6.0.0', require: 'action_view'
6
+
7
+ gem 'selenium-webdriver'
8
+
9
+ platforms :ruby do
10
+ gem 'sqlite3', require: false
11
+ gem 'pg', require: false
12
+ gem 'mysql2', require: false
13
+ end
14
+ platforms :jruby do
15
+ gem 'activerecord-jdbcsqlite3-adapter', '>= 1.3.0'
16
+ gem 'activerecord-jdbcpostgresql-adapter', require: false
17
+ gem 'activerecord-jdbcmysql-adapter', require: false
18
+ end
19
+ platforms :rbx do
20
+ gem 'rubysl', '~> 2.0'
21
+ gem 'racc'
22
+ gem 'minitest'
23
+ gem 'rubinius-developer_tools'
24
+ end
25
+
26
+ gemspec path: '../'
@@ -11,15 +11,10 @@ github 'rails/rails' do
11
11
  gem 'actionview', require: 'action_view'
12
12
  end
13
13
 
14
- gem 'rack', github: 'rack/rack'
15
- gem 'arel', github: 'rails/arel'
14
+ gem 'selenium-webdriver'
16
15
 
17
16
  platforms :ruby do
18
- if RUBY_VERSION > "2.1.0"
19
- gem 'sqlite3', require: false
20
- else
21
- gem 'sqlite3', '1.3.8', require: false
22
- end
17
+ gem 'sqlite3', require: false
23
18
  gem 'pg', require: false
24
19
  gem 'mysql2', require: false
25
20
  end
@@ -1,5 +1,5 @@
1
- # -*- encoding: utf-8 -*-
2
1
  # frozen_string_literal: true
2
+
3
3
  $:.push File.expand_path("../lib", __FILE__)
4
4
  require "kaminari/version"
5
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'kaminari/core'
3
4
  require 'kaminari/actionview'
4
5
  require 'kaminari/activerecord'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Kaminari
3
- VERSION = '1.1.1'
4
+ VERSION = '1.2.0'
4
5
  end
@@ -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.1"
15
- gem "kaminari-activerecord", "1.0.1"
14
+ gem "kaminari-core"
15
+ gem "kaminari-activerecord"
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.1.1
4
+ version: 1.2.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-10-21 00:00:00.000000000 Z
14
+ date: 2020-01-30 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.1.1
36
+ version: 1.2.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.1.1
43
+ version: 1.2.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.1.1
50
+ version: 1.2.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.1.1
57
+ version: 1.2.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.1.1
64
+ version: 1.2.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.1.1
71
+ version: 1.2.0
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: test-unit-rails
74
74
  requirement: !ruby/object:Gem::Requirement
@@ -161,6 +161,8 @@ files:
161
161
  - gemfiles/active_record_42.gemfile
162
162
  - gemfiles/active_record_50.gemfile
163
163
  - gemfiles/active_record_51.gemfile
164
+ - gemfiles/active_record_52.gemfile
165
+ - gemfiles/active_record_60.gemfile
164
166
  - gemfiles/active_record_edge.gemfile
165
167
  - kaminari.gemspec
166
168
  - lib/kaminari.rb
@@ -185,8 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
187
  - !ruby/object:Gem::Version
186
188
  version: '0'
187
189
  requirements: []
188
- rubyforge_project:
189
- rubygems_version: 2.6.14
190
+ rubygems_version: 3.1.2
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: A pagination engine plugin for Rails 4+ and other modern frameworks