kaminari-mongoid 1.0.1 → 1.0.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
- SHA1:
3
- metadata.gz: 6d87b2e3af14ed6f038068d2b21d83264c4f0d91
4
- data.tar.gz: 5b57372e8544caee7c4ed32e45f0347a569eb451
2
+ SHA256:
3
+ metadata.gz: 39c49d86e68f35086ca61ed72ef6bb427c5e36b0c1f86dbc7569413cc6b35668
4
+ data.tar.gz: 4696911080d0791c0c0aaaf68eaf538b515817c0ae2cb202ceda5c793ff1abdb
5
5
  SHA512:
6
- metadata.gz: 40f93c2aa8d0a933655591b8694c3ecc410c8a8a263e428d5ae5a6dfc6b05fe6ff4998de1b86eab49f3cc63b89a99772b156fb4f29bcf50c1ca92fa764d50bbd
7
- data.tar.gz: 12dc2644487eaf7ffe35f46d02ecc24f1abc42d88451cdeb4ee7576c6a3747b9e1c7cc01d898d7660350d6c1f8572b2db8a1790fa0173b9806ed1fa14cb2d4e9
6
+ metadata.gz: 49062bc8dfb5bee854aa1dd8ab7cc1204153a94cb2c9e8ef88d5e92e11de9f452b498eaad7ba53eaec48db479d22710482d32c222df086a970c95bbde5ab97ba
7
+ data.tar.gz: 1ff9bdedbfd926ca597f7a7640425cd80aa91295b8a20ad08f7fcebe0b24b5fcd5815836de6b5cc557eefef6c2c334b1ad48ee6670dd1909879843977efe712a
@@ -0,0 +1,68 @@
1
+ name: build
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ fail-fast: true
9
+
10
+ # see https://docs.mongodb.com/mongoid/current/tutorials/mongoid-installation/ for supported versions
11
+ matrix:
12
+ ruby_version: ['3.0', '2.7', '2.6', '2.5']
13
+ gemfile:
14
+ - gemfiles/mongoid_73.gemfile
15
+ - gemfiles/mongoid_72.gemfile
16
+ - gemfiles/mongoid_71.gemfile
17
+ - gemfiles/mongoid_70.gemfile
18
+ - gemfiles/mongoid_64.gemfile
19
+
20
+ exclude:
21
+ - ruby_version: '3.0'
22
+ gemfile: gemfiles/mongoid_70.gemfile
23
+ - ruby_version: '3.0'
24
+ gemfile: gemfiles/mongoid_64.gemfile
25
+ - ruby_version: '2.7'
26
+ gemfile: gemfiles/mongoid_64.gemfile
27
+
28
+ include:
29
+ - ruby_version: '2.5'
30
+ gemfile: gemfiles/mongoid_63.gemfile
31
+ - ruby_version: '2.5'
32
+ gemfile: gemfiles/mongoid_62.gemfile
33
+ - ruby_version: '2.4'
34
+ gemfile: gemfiles/mongoid_61.gemfile
35
+ - ruby_version: '2.3'
36
+ gemfile: gemfiles/mongoid_60.gemfile
37
+ - ruby_version: '2.3'
38
+ gemfile: gemfiles/mongoid_54.gemfile
39
+ bundler_version: '1'
40
+ - ruby_version: '2.2'
41
+ gemfile: gemfiles/mongoid_52.gemfile
42
+ - ruby_version: '2.2'
43
+ gemfile: gemfiles/mongoid_51.gemfile
44
+ - ruby_version: '2.1'
45
+ gemfile: gemfiles/mongoid_50.gemfile
46
+ - ruby_version: '2.1'
47
+ gemfile: gemfiles/mongoid_40.gemfile
48
+
49
+
50
+ runs-on: ubuntu-18.04
51
+
52
+ env:
53
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
54
+
55
+ steps:
56
+ - uses: actions/checkout@v2
57
+
58
+ - uses: ruby/setup-ruby@v1
59
+ with:
60
+ ruby-version: ${{ matrix.ruby_version }}
61
+ bundler-cache: true
62
+ bundler: ${{ matrix.bundler_version || 'latest' }}
63
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
64
+
65
+ - uses: supercharge/mongodb-github-action@1.7.0
66
+
67
+ - run: bundle exec rake
68
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ ## 1.0.2
2
+
3
+ * `max_pages` support
4
+
5
+ ## 1.0.0
6
+
7
+ * Extracted from kaminari gem
8
+
9
+ * Droped mongoid 3.0 and 3.1 support
data/Gemfile CHANGED
@@ -4,4 +4,7 @@ source 'https://rubygems.org'
4
4
  # Specify your gem's dependencies in kaminari-mongoid.gemspec
5
5
  gemspec
6
6
 
7
- gem 'kaminari-core', github: 'kaminari/kaminari'
7
+ unless ENV['CI']
8
+ gem 'kaminari-core', path: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+ end
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Kaminari::Mongoid
1
+ # Kaminari::Mongoid [![Build Status](https://travis-ci.org/kaminari/kaminari-mongoid.svg?branch=master)](https://travis-ci.org/kaminari/kaminari-mongoid)
2
2
 
3
3
  Kaminari Mongoid adapter.
4
4
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/testtask'
5
5
  Rake::TestTask.new do |t|
6
6
  t.libs << 'test'
7
7
  t.pattern = "{test,#{File.join(Gem.loaded_specs['kaminari-core'].gem_dir, 'test')}}/**/*_test.rb"
8
- t.warning = true
8
+ t.warning = false
9
9
  t.verbose = true
10
10
  end
11
11
 
@@ -11,19 +11,8 @@ gem 'kaminari-actionview', github: 'kaminari/kaminari'
11
11
  gem 'railties', '~> 4.0'
12
12
  gem 'mongoid', '~> 4.0.0'
13
13
 
14
- if RUBY_VERSION > '1.9.3'
15
- gem 'mime-types'
16
- else
17
- gem 'mime-types', '2.99'
18
- end
14
+ gem 'mime-types'
19
15
 
20
16
  gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
21
17
 
22
- platforms :rbx do
23
- gem 'rubysl', '~> 2.0'
24
- gem 'racc'
25
- gem 'minitest'
26
- gem 'rubinius-developer_tools'
27
- end
28
-
29
18
  gemspec :path => '../'
@@ -11,19 +11,8 @@ gem 'kaminari-actionview', github: 'kaminari/kaminari'
11
11
  gem 'railties', '~> 4.0'
12
12
  gem 'mongoid', '~> 5.0.0'
13
13
 
14
- if RUBY_VERSION > '1.9.3'
15
- gem 'mime-types'
16
- else
17
- gem 'mime-types', '2.99'
18
- end
14
+ gem 'mime-types'
19
15
 
20
16
  gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
21
17
 
22
- platforms :rbx do
23
- gem 'rubysl', '~> 2.0'
24
- gem 'racc'
25
- gem 'minitest'
26
- gem 'rubinius-developer_tools'
27
- end
28
-
29
18
  gemspec :path => '../'
@@ -11,19 +11,8 @@ gem 'kaminari-actionview', github: 'kaminari/kaminari'
11
11
  gem 'railties', '~> 4.0'
12
12
  gem 'mongoid', '~> 5.1.0'
13
13
 
14
- if RUBY_VERSION > '1.9.3'
15
- gem 'mime-types'
16
- else
17
- gem 'mime-types', '2.99'
18
- end
14
+ gem 'mime-types'
19
15
 
20
16
  gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
21
17
 
22
- platforms :rbx do
23
- gem 'rubysl', '~> 2.0'
24
- gem 'racc'
25
- gem 'minitest'
26
- gem 'rubinius-developer_tools'
27
- end
28
-
29
18
  gemspec :path => '../'
@@ -0,0 +1,18 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 4.0'
12
+ gem 'mongoid', '~> 5.2.0'
13
+
14
+ gem 'mime-types'
15
+
16
+ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
17
+
18
+ gemspec :path => '../'
@@ -0,0 +1,18 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 4.0'
12
+ gem 'mongoid', '~> 5.4.0'
13
+
14
+ gem 'mime-types'
15
+
16
+ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
17
+
18
+ gemspec :path => '../'
@@ -11,17 +11,6 @@ gem 'kaminari-actionview', github: 'kaminari/kaminari'
11
11
  gem 'railties', '~> 5.0'
12
12
  gem 'mongoid', '~> 6.0.0'
13
13
 
14
- if RUBY_VERSION > '1.9.3'
15
- gem 'mime-types'
16
- else
17
- gem 'mime-types', '2.99'
18
- end
19
-
20
- platforms :rbx do
21
- gem 'rubysl', '~> 2.0'
22
- gem 'racc'
23
- gem 'minitest'
24
- gem 'rubinius-developer_tools'
25
- end
14
+ gem 'mime-types'
26
15
 
27
16
  gemspec :path => '../'
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 5.0'
12
+ gem 'mongoid', '~> 6.1.0'
13
+
14
+ gem 'mime-types'
15
+
16
+ gemspec :path => '../'
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 5.2'
12
+ gem 'mongoid', '~> 6.2.0'
13
+
14
+ gem 'mime-types'
15
+
16
+ gemspec :path => '../'
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 5.2'
12
+ gem 'mongoid', '~> 6.3.0'
13
+
14
+ gem 'mime-types'
15
+
16
+ gemspec :path => '../'
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 5.2'
12
+ gem 'mongoid', '~> 6.4.0'
13
+
14
+ gem 'mime-types'
15
+
16
+ gemspec :path => '../'
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 6.1'
12
+ gem 'selenium-webdriver'
13
+ gem 'mongoid', '~> 7.0.0'
14
+
15
+ gem 'mime-types'
16
+
17
+ gemspec :path => '../'
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 6.1'
12
+ gem 'selenium-webdriver'
13
+ gem 'mongoid', '~> 7.1.0'
14
+
15
+ gem 'mime-types'
16
+
17
+ gemspec :path => '../'
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 6.1'
12
+ gem 'selenium-webdriver'
13
+ gem 'mongoid', '~> 7.2.0'
14
+
15
+ gem 'mime-types'
16
+
17
+ gemspec :path => '../'
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+ git_source(:github) do |repo_name|
3
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
4
+ "https://github.com/#{repo_name}.git"
5
+ end
6
+
7
+ # bundle GH master to load kaminari-core/test directory which is not included in the packaged gems
8
+ gem 'kaminari-core', github: 'kaminari/kaminari'
9
+ gem 'kaminari-actionview', github: 'kaminari/kaminari'
10
+
11
+ gem 'railties', '~> 6.1'
12
+ gem 'selenium-webdriver'
13
+ gem 'mongoid', '~> 7.3.0'
14
+
15
+ gem 'mime-types'
16
+
17
+ gemspec :path => '../'
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'kaminari-core', '~> 1.0'
24
24
  spec.add_dependency 'mongoid'
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.9"
27
26
  spec.add_development_dependency "rake"
28
27
  spec.add_development_dependency 'rails'
29
28
  spec.add_development_dependency 'test-unit-rails'
@@ -22,8 +22,10 @@ module Kaminari
22
22
  def total_count #:nodoc:
23
23
  @total_count ||= if embedded?
24
24
  unpage.size
25
- elsif options[:max_scan] && options[:max_scan] < size
25
+ elsif options[:max_scan] && (options[:max_scan] < size)
26
26
  options[:max_scan]
27
+ elsif max_pages && (max_pages * limit_value < size)
28
+ max_pages * limit_value
27
29
  else
28
30
  size
29
31
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Kaminari
3
3
  module Mongoid
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaminari-mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2021-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari-core
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.9'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.9'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rake
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -143,8 +129,9 @@ executables: []
143
129
  extensions: []
144
130
  extra_rdoc_files: []
145
131
  files:
132
+ - ".github/workflows/main.yml"
146
133
  - ".gitignore"
147
- - ".travis.yml"
134
+ - CHANGELOG.md
148
135
  - Gemfile
149
136
  - MIT-LICENSE
150
137
  - README.md
@@ -154,7 +141,17 @@ files:
154
141
  - gemfiles/mongoid_40.gemfile
155
142
  - gemfiles/mongoid_50.gemfile
156
143
  - gemfiles/mongoid_51.gemfile
144
+ - gemfiles/mongoid_52.gemfile
145
+ - gemfiles/mongoid_54.gemfile
157
146
  - gemfiles/mongoid_60.gemfile
147
+ - gemfiles/mongoid_61.gemfile
148
+ - gemfiles/mongoid_62.gemfile
149
+ - gemfiles/mongoid_63.gemfile
150
+ - gemfiles/mongoid_64.gemfile
151
+ - gemfiles/mongoid_70.gemfile
152
+ - gemfiles/mongoid_71.gemfile
153
+ - gemfiles/mongoid_72.gemfile
154
+ - gemfiles/mongoid_73.gemfile
158
155
  - kaminari-mongoid.gemspec
159
156
  - lib/kaminari/mongoid.rb
160
157
  - lib/kaminari/mongoid/mongoid_criteria_methods.rb
@@ -164,7 +161,7 @@ homepage: https://github.com/kaminari/kaminari-mongoid
164
161
  licenses:
165
162
  - MIT
166
163
  metadata: {}
167
- post_install_message:
164
+ post_install_message:
168
165
  rdoc_options: []
169
166
  require_paths:
170
167
  - lib
@@ -179,9 +176,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
176
  - !ruby/object:Gem::Version
180
177
  version: '0'
181
178
  requirements: []
182
- rubyforge_project:
183
- rubygems_version: 2.6.9
184
- signing_key:
179
+ rubygems_version: 3.3.0.dev
180
+ signing_key:
185
181
  specification_version: 4
186
182
  summary: Kaminari Mongoid adapter
187
183
  test_files: []
data/.travis.yml DELETED
@@ -1,46 +0,0 @@
1
- language: ruby
2
-
3
- before_install: gem update bundler
4
-
5
- rvm:
6
- - 2.0.0
7
- - 2.1.10
8
- - 2.2.6
9
- - 2.3.3
10
- - 2.4.0
11
- - ruby-head
12
- - jruby-9.1.7.0
13
- - rbx-2
14
-
15
- gemfile:
16
- - gemfiles/mongoid_40.gemfile
17
- - gemfiles/mongoid_50.gemfile
18
- - gemfiles/mongoid_51.gemfile
19
- - gemfiles/mongoid_60.gemfile
20
-
21
- sudo: false
22
-
23
- services: mongodb
24
-
25
- script: 'bundle exec rake test'
26
-
27
- cache: bundler
28
-
29
- matrix:
30
- exclude:
31
- - rvm: 2.0.0
32
- gemfile: gemfiles/mongoid_60.gemfile
33
- - rvm: 2.1.10
34
- gemfile: gemfiles/mongoid_60.gemfile
35
- allow_failures:
36
- - rvm: ruby-head
37
- - rvm: jruby-9.1.7.0
38
- - rvm: rbx-2
39
- # mongoid < 6 depends on activemodel < 5 that depends on json < 2 that currently doesn't support ruby 2.4
40
- - rvm: 2.4.0
41
- gemfile: gemfiles/mongoid_40.gemfile
42
- - rvm: 2.4.0
43
- gemfile: gemfiles/mongoid_50.gemfile
44
- - rvm: 2.4.0
45
- gemfile: gemfiles/mongoid_51.gemfile
46
- fast_finish: true