kaminari-mongoid 0.1.2 → 1.0.0.rc1

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
2
  SHA1:
3
- metadata.gz: 1f9fcf5388c2b1acb0a2f1c83f5a64e9cc524453
4
- data.tar.gz: a8a5b33ea8798ec9d9ffd17eb65ca2b86a7f91b1
3
+ metadata.gz: 31cd50f7166e06faa660db8a83466759e1ef1854
4
+ data.tar.gz: e91dfdc44c788993c5c64ae0c44d5a8aea403542
5
5
  SHA512:
6
- metadata.gz: 90abc7adfe4514b010941787c0d86add43168704ddd50a8f7eaa3aaeebdc059966ceaf2ec40bebc62f646aea7e6665d4c1ad560c386388f1db6deae5c216fcfb
7
- data.tar.gz: 1f639e7601dad7b83f1616b4f3fbe3985498f1ae82c86a21ec2d593e76ae3c925b23ec93f667719888a342b3f7c31a7fb34aa00d1305d3637dda197d61e864dc
6
+ metadata.gz: 5b001e517679de215eebf994258e3c8c6fc34b54f589c976a9ca4b2f7faa180d74491dd1364b94b4fdaf72c2211af298dc241a9e0796cb04b18593eb90ec616e
7
+ data.tar.gz: 84f3bde0938fa9ab383e041a103c011e6f475c24fc5ea1683f903fcfe82a3d4c7789bb356134d4cd86c2aff78f6f02b6c494d5b4785b15f867f0b3ed03707243
data/.travis.yml CHANGED
@@ -1,36 +1,38 @@
1
1
  language: ruby
2
2
 
3
- before_install: gem install bundler -v 1.11.2
3
+ before_install: gem update bundler
4
4
 
5
5
  rvm:
6
6
  - 2.0.0
7
7
  - 2.1.10
8
- - 2.2.4
9
- - 2.3.1
8
+ - 2.2.6
9
+ - 2.3.3
10
10
  - ruby-head
11
- - jruby
12
- - jruby-head
11
+ - jruby-9.1.5.0
13
12
  - rbx-2
14
13
 
15
14
  gemfile:
16
- - gemfiles/mongoid_30.gemfile
17
- - gemfiles/mongoid_31.gemfile
18
15
  - gemfiles/mongoid_40.gemfile
19
16
  - gemfiles/mongoid_50.gemfile
20
17
  - gemfiles/mongoid_51.gemfile
18
+ - gemfiles/mongoid_60.gemfile
21
19
 
22
20
  sudo: false
23
21
 
24
22
  services: mongodb
25
23
 
26
- script: "bundle exec rake spec"
24
+ script: 'bundle exec rake test'
27
25
 
28
26
  cache: bundler
29
27
 
30
28
  matrix:
29
+ exclude:
30
+ - rvm: 2.0.0
31
+ gemfile: gemfiles/mongoid_60.gemfile
32
+ - rvm: 2.1.10
33
+ gemfile: gemfiles/mongoid_60.gemfile
31
34
  allow_failures:
32
35
  - rvm: ruby-head
33
- - rvm: jruby
34
- - rvm: jruby-head
36
+ - rvm: jruby-9.1.5.0
35
37
  - rvm: rbx-2
36
38
  fast_finish: true
data/Gemfile CHANGED
@@ -1,8 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
 
3
4
  # Specify your gem's dependencies in kaminari-mongoid.gemspec
4
5
  gemspec
5
6
 
6
- gem 'database_cleaner', git: 'git@github.com:DatabaseCleaner/database_cleaner.git'
7
-
8
- gem 'kaminari', github: 'amatsuda/kaminari'
7
+ gem 'kaminari-core', github: 'amatsuda/kaminari'
data/README.md CHANGED
@@ -21,7 +21,7 @@ And bundle.
21
21
 
22
22
  ## Usage
23
23
 
24
- See [Kaminari README](https://github.com/amatsuda/kaminari/blob/master/README.rdoc).
24
+ See [Kaminari README](https://github.com/amatsuda/kaminari/blob/master/README.md).
25
25
 
26
26
 
27
27
  ## Contributing
data/Rakefile CHANGED
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
1
2
  require "bundler/gem_tasks"
2
- require 'rspec/core'
3
- require 'rspec/core/rake_task'
3
+ require 'rake/testtask'
4
4
 
5
- RSpec::Core::RakeTask.new(:spec) do |spec|
6
- spec.pattern = [FileList['spec/**/*_spec.rb'], FileList["#{File.join(Gem.loaded_specs['kaminari'].gem_dir, 'spec')}/**/*_spec.rb"]].flatten
5
+ Rake::TestTask.new do |t|
6
+ t.libs << 'test'
7
+ t.pattern = "{test,#{File.join(Gem.loaded_specs['kaminari-core'].gem_dir, 'test')}}/**/*_test.rb"
8
+ t.warning = true
9
+ t.verbose = true
7
10
  end
8
11
 
9
- task default: :spec
12
+ task default: :test
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
  require "kaminari/mongoid"
@@ -1,11 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  #FIXME bundle GH branch for now
4
- gem 'kaminari', github: 'amatsuda/kaminari', branch: 'extract_adapters'
4
+ gem 'kaminari-core', github: 'amatsuda/kaminari'
5
+ gem 'kaminari-actionview', github: 'amatsuda/kaminari'
5
6
 
6
7
  gem 'railties', '~> 4.0'
7
8
  gem 'mongoid', '~> 4.0.0'
8
- gem 'rspec-rails', '~> 2.14.1'
9
9
 
10
10
  if RUBY_VERSION > '1.9.3'
11
11
  gem 'mime-types'
@@ -1,11 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  #FIXME bundle GH branch for now
4
- gem 'kaminari', github: 'amatsuda/kaminari', branch: 'extract_adapters'
4
+ gem 'kaminari-core', github: 'amatsuda/kaminari'
5
+ gem 'kaminari-actionview', github: 'amatsuda/kaminari'
5
6
 
6
7
  gem 'railties', '~> 4.0'
7
8
  gem 'mongoid', '~> 5.0.0'
8
- gem 'rspec-rails', '~> 2.14.1'
9
9
 
10
10
  if RUBY_VERSION > '1.9.3'
11
11
  gem 'mime-types'
@@ -1,11 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  #FIXME bundle GH branch for now
4
- gem 'kaminari', github: 'amatsuda/kaminari', branch: 'extract_adapters'
4
+ gem 'kaminari-core', github: 'amatsuda/kaminari'
5
+ gem 'kaminari-actionview', github: 'amatsuda/kaminari'
5
6
 
6
7
  gem 'railties', '~> 4.0'
7
8
  gem 'mongoid', '~> 5.1.0'
8
- gem 'rspec-rails', '~> 2.14.1'
9
9
 
10
10
  if RUBY_VERSION > '1.9.3'
11
11
  gem 'mime-types'
@@ -0,0 +1,31 @@
1
+ source 'https://rubygems.org'
2
+
3
+ #FIXME bundle GH branch for now
4
+ gem 'kaminari-core', github: 'amatsuda/kaminari'
5
+ gem 'kaminari-actionview', github: 'amatsuda/kaminari'
6
+
7
+ gem 'railties', '~> 5.0'
8
+ gem 'mongoid', '~> 6.0.0'
9
+
10
+ if RUBY_VERSION > '1.9.3'
11
+ gem 'mime-types'
12
+ else
13
+ gem 'mime-types', '2.99'
14
+ end
15
+
16
+ group :development, :test do
17
+ gem 'database_cleaner', '~> 1.5.1'
18
+ end
19
+
20
+ platforms :mri do
21
+ gem 'test-unit' if RUBY_VERSION > '2.1.0'
22
+ end
23
+
24
+ platforms :rbx do
25
+ gem 'rubysl', '~> 2.0'
26
+ gem 'racc'
27
+ gem 'minitest'
28
+ gem 'rubinius-developer_tools'
29
+ end
30
+
31
+ gemspec :path => '../'
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'kaminari/mongoid/version'
@@ -10,7 +11,7 @@ Gem::Specification.new do |spec|
10
11
  spec.email = ["ronnie@dio.jp"]
11
12
 
12
13
  spec.summary = 'Kaminari Mongoid adapter'
13
- spec.description = 'Kaminari Mongoid adapter'
14
+ spec.description = 'kaminari-mongoid lets your Mongoid models be paginatable'
14
15
  spec.homepage = 'https://github.com/kaminari/kaminari-mongoid'
15
16
  spec.license = "MIT"
16
17
 
@@ -19,12 +20,13 @@ Gem::Specification.new do |spec|
19
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
21
  spec.require_paths = ["lib"]
21
22
 
22
- spec.add_dependency 'kaminari'
23
+ spec.add_dependency 'kaminari-core', Kaminari::Mongoid::VERSION
24
+ spec.add_dependency 'mongoid'
25
+
23
26
  spec.add_development_dependency "bundler", "~> 1.9"
24
27
  spec.add_development_dependency "rake", "~> 10.0"
25
- spec.add_development_dependency 'mongoid'
26
28
  spec.add_development_dependency 'rails'
27
- spec.add_development_dependency 'rspec-rails', '~> 2.14.1'
29
+ spec.add_development_dependency 'test-unit-rails'
28
30
  spec.add_development_dependency 'capybara'
29
31
  spec.add_development_dependency 'database_cleaner'
30
32
  spec.add_development_dependency 'rr'
@@ -1,4 +1,5 @@
1
- require 'kaminari'
1
+ # frozen_string_literal: true
2
+ require 'kaminari/core'
2
3
  require 'mongoid'
3
4
  require 'kaminari/mongoid/mongoid_extension'
4
5
  ::Mongoid::Document.send :include, Kaminari::Mongoid::MongoidExtension::Document
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Kaminari
2
3
  module Mongoid
3
4
  module MongoidCriteriaMethods
@@ -6,8 +7,8 @@ module Kaminari
6
7
  super
7
8
  end
8
9
 
9
- def entry_name
10
- model_name.human.downcase
10
+ def entry_name(options = {})
11
+ model_name.human(options.reverse_merge(default: model_name.human.pluralize(options[:count])))
11
12
  end
12
13
 
13
14
  def limit_value #:nodoc:
@@ -21,12 +22,10 @@ module Kaminari
21
22
  def total_count #:nodoc:
22
23
  @total_count ||= if embedded?
23
24
  unpage.size
25
+ elsif options[:max_scan] && options[:max_scan] < size
26
+ options[:max_scan]
24
27
  else
25
- if options[:max_scan] && options[:max_scan] < size
26
- options[:max_scan]
27
- else
28
- size
29
- end
28
+ size
30
29
  end
31
30
  end
32
31
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'kaminari/mongoid/mongoid_criteria_methods'
2
3
 
3
4
  module Kaminari
@@ -1,5 +1,6 @@
1
+ # frozen_string_literal: true
1
2
  module Kaminari
2
3
  module Mongoid
3
- VERSION = "0.1.2"
4
+ VERSION = '1.0.0.rc1'
4
5
  end
5
6
  end
metadata CHANGED
@@ -1,17 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaminari-mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: kaminari
14
+ name: kaminari-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.0.rc1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.0.rc1
27
+ - !ruby/object:Gem::Dependency
28
+ name: mongoid
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
@@ -53,7 +67,7 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '10.0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: mongoid
70
+ name: rails
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -67,7 +81,7 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: rails
84
+ name: test-unit-rails
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -80,20 +94,6 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rspec-rails
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 2.14.1
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 2.14.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: capybara
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +150,7 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description: Kaminari Mongoid adapter
153
+ description: kaminari-mongoid lets your Mongoid models be paginatable
154
154
  email:
155
155
  - ronnie@dio.jp
156
156
  executables: []
@@ -158,7 +158,6 @@ extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
160
  - ".gitignore"
161
- - ".rspec"
162
161
  - ".travis.yml"
163
162
  - Gemfile
164
163
  - MIT-LICENSE
@@ -166,11 +165,10 @@ files:
166
165
  - Rakefile
167
166
  - bin/console
168
167
  - bin/setup
169
- - gemfiles/mongoid_30.gemfile
170
- - gemfiles/mongoid_31.gemfile
171
168
  - gemfiles/mongoid_40.gemfile
172
169
  - gemfiles/mongoid_50.gemfile
173
170
  - gemfiles/mongoid_51.gemfile
171
+ - gemfiles/mongoid_60.gemfile
174
172
  - kaminari-mongoid.gemspec
175
173
  - lib/kaminari/mongoid.rb
176
174
  - lib/kaminari/mongoid/mongoid_criteria_methods.rb
@@ -191,12 +189,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
189
  version: '0'
192
190
  required_rubygems_version: !ruby/object:Gem::Requirement
193
191
  requirements:
194
- - - ">="
192
+ - - ">"
195
193
  - !ruby/object:Gem::Version
196
- version: '0'
194
+ version: 1.3.1
197
195
  requirements: []
198
196
  rubyforge_project:
199
- rubygems_version: 2.6.4
197
+ rubygems_version: 2.6.8
200
198
  signing_key:
201
199
  specification_version: 4
202
200
  summary: Kaminari Mongoid adapter
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
@@ -1,30 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- #FIXME bundle GH branch for now
4
- gem 'kaminari', github: 'amatsuda/kaminari', branch: 'extract_adapters'
5
-
6
- gem 'railties', '>= 3.2.3'
7
- gem 'mongoid', '~> 3.0.0'
8
- gem 'rspec-rails', '~> 2.14.1'
9
- gem 'origin'
10
- gem 'moped'
11
- gem 'activesupport', '~> 3.2.18'
12
-
13
- if RUBY_VERSION > '1.9.3'
14
- gem 'mime-types'
15
- else
16
- gem 'mime-types', '2.99'
17
- end
18
-
19
- platforms :mri do
20
- gem 'test-unit' if RUBY_VERSION > "2.1.0"
21
- end
22
-
23
- platforms :rbx do
24
- gem 'rubysl', '~> 2.0'
25
- gem 'racc'
26
- gem 'rubysl-test-unit', github: 'rubysl/rubysl-test-unit', branch: '2.0'
27
- gem 'rubinius-developer_tools'
28
- end
29
-
30
- gemspec :path => '../'
@@ -1,29 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- #FIXME bundle GH branch for now
4
- gem 'kaminari', github: 'amatsuda/kaminari', branch: 'extract_adapters'
5
-
6
- gem 'railties', '~> 3.2'
7
- gem 'mongoid', '~> 3.1.0'
8
- gem 'rspec-rails', '~> 2.14.1'
9
- gem 'origin'
10
- gem 'moped'
11
-
12
- if RUBY_VERSION > '1.9.3'
13
- gem 'mime-types'
14
- else
15
- gem 'mime-types', '2.99'
16
- end
17
-
18
- platforms :mri do
19
- gem 'test-unit' if RUBY_VERSION > "2.1.0"
20
- end
21
-
22
- platforms :rbx do
23
- gem 'rubysl', '~> 2.0'
24
- gem 'racc'
25
- gem 'rubysl-test-unit', github: 'rubysl/rubysl-test-unit', branch: '2.0'
26
- gem 'rubinius-developer_tools'
27
- end
28
-
29
- gemspec :path => '../'