mongoid-compatibility 0.5.1 → 1.0.0

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: cb8def381a7ad257f0a23674cf613f8762013a52
4
- data.tar.gz: db94cbe66a50eca96cc1d41c2e8a7f9df95b4fec
2
+ SHA256:
3
+ metadata.gz: 96242e8dafcc50fb30c71364aaa0ae2e4fef1dc0a4fb1b53dacd7e6a05633ddd
4
+ data.tar.gz: 9bacbead3c2d71b3127b63afacb54a79da599fd8eb5616764ee4e70ae1beaf72
5
5
  SHA512:
6
- metadata.gz: 7b2cd8310aad4d88c0ec2ca8257adf4e943752e046a1c8ca96eaf65589b94212a261847815dbe6c38a1c319288519fc6a0717219037850339798aba5e815e136
7
- data.tar.gz: e1898cb7f37f293c6559d7614ab4b941c04205184b9a5ce3b49889ffeeeddbcac4bfe184844110d6df046bb78e9ef25a12815dcb70e09eaa287a053b89197bae
6
+ metadata.gz: c5ab33ff6bf40cce9fb20c666af1d660cd9730225f592bc552c9c81a0b2b111cc3e68a7b5c051498aa529f9df7a60e01e2738b8b8cc038a8f373ad6b758f4463
7
+ data.tar.gz: 5c882b1b39c3b3c66d1a2e2527f7d211607cf83be373066fe9da70977611aab34dcbcd0a4ce3fffd76c9c2e708bfc4e9aeaeb396fe7c5f6bdb0a128c6eca737e
@@ -0,0 +1,17 @@
1
+ name: PR Linter
2
+ on: [pull_request]
3
+ jobs:
4
+ danger:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v3
8
+ with:
9
+ fetch-depth: 0
10
+ - uses: ruby/setup-ruby@v1
11
+ with:
12
+ ruby-version: 2.7
13
+ bundler-cache: true
14
+ - run: |
15
+ # Personal access token for dangerpr-bot - public, but base64 encoded to avoid tripping up GitHub
16
+ TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode)
17
+ DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
@@ -0,0 +1,13 @@
1
+ name: Rubocop
2
+ on: [push, pull_request]
3
+ jobs:
4
+ lint:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v2
8
+ - name: Set up Ruby
9
+ uses: ruby/setup-ruby@v1
10
+ with:
11
+ ruby-version: 2.7
12
+ bundler-cache: true
13
+ - run: bundle exec rubocop
@@ -0,0 +1,83 @@
1
+ name: CI RSpec Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name: >-
8
+ Mongoid Test with: - Ruby ${{ matrix.entry.ruby }} - MongoDB ${{ matrix.entry.mongodb }} - Gemfile ${{ matrix.entry.gemfile }})
9
+ env:
10
+ CI: true
11
+ TESTOPTS: "-v"
12
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.entry.gemfile }}.gemfile
13
+ runs-on: ubuntu-latest
14
+ continue-on-error: false
15
+ strategy:
16
+ matrix:
17
+ entry:
18
+ - { ruby: "2.6", gemfile: 'mongoid_3', mongodb: "3.6" }
19
+ - { ruby: "2.6", gemfile: 'mongoid_4', mongodb: "3.6" }
20
+ - { ruby: "2.6", gemfile: 'mongoid_4', mongodb: "3.6" }
21
+ - { ruby: "2.6", gemfile: 'mongoid_5', mongodb: "3.6" }
22
+ - { ruby: "2.6", gemfile: 'mongoid_5', mongodb: "3.6" }
23
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "3.6" }
24
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "3.6" }
25
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "3.6" }
26
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "3.6" }
27
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "3.6" }
28
+ - { ruby: "2.7", gemfile: 'mongoid_7', mongodb: "3.6" }
29
+ - { ruby: "3.0", gemfile: 'mongoid_8', mongodb: "3.6" }
30
+ - { ruby: "3.1", gemfile: 'mongoid_8', mongodb: "3.6" }
31
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "4.0" }
32
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "4.0" }
33
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "4.0" }
34
+ - { ruby: "2.7", gemfile: 'mongoid_7', mongodb: "4.0" }
35
+ - { ruby: "3.0", gemfile: 'mongoid_8', mongodb: "4.0" }
36
+ - { ruby: "3.1", gemfile: 'mongoid_8', mongodb: "4.0" }
37
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "4.2" }
38
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "4.2" }
39
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "4.2" }
40
+ - { ruby: "2.7", gemfile: 'mongoid_7', mongodb: "4.2" }
41
+ - { ruby: "3.0", gemfile: 'mongoid_8', mongodb: "4.2" }
42
+ - { ruby: "3.1", gemfile: 'mongoid_8', mongodb: "4.2" }
43
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "4.4" }
44
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "4.4" }
45
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "4.4" }
46
+ - { ruby: "2.7", gemfile: 'mongoid_7', mongodb: "4.4" }
47
+ - { ruby: "3.0", gemfile: 'mongoid_8', mongodb: "4.4" }
48
+ - { ruby: "3.1", gemfile: 'mongoid_8', mongodb: "4.4" }
49
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "5.0" }
50
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "5.0" }
51
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "5.0" }
52
+ - { ruby: "2.7", gemfile: 'mongoid_7', mongodb: "5.0" }
53
+ - { ruby: "3.0", gemfile: 'mongoid_8', mongodb: "5.0" }
54
+ - { ruby: "3.1", gemfile: 'mongoid_8', mongodb: "5.0" }
55
+ - { ruby: "3.1", gemfile: 'mongoid_9', mongodb: "5.0" }
56
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "6.0" }
57
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "6.0" }
58
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "6.0" }
59
+ - { ruby: "2.7", gemfile: 'mongoid_7', mongodb: "6.0" }
60
+ - { ruby: "3.0", gemfile: 'mongoid_8', mongodb: "6.0" }
61
+ - { ruby: "3.1", gemfile: 'mongoid_8', mongodb: "6.0" }
62
+ - { ruby: "3.1", gemfile: 'mongoid_9', mongodb: "6.0" }
63
+ - { ruby: "2.6", gemfile: 'mongoid_6', mongodb: "7.0" }
64
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "7.0" }
65
+ - { ruby: "2.6", gemfile: 'mongoid_7', mongodb: "7.0" }
66
+ - { ruby: "2.7", gemfile: 'mongoid_7', mongodb: "7.0" }
67
+ - { ruby: "3.0", gemfile: 'mongoid_8', mongodb: "7.0" }
68
+ - { ruby: "3.1", gemfile: 'mongoid_8', mongodb: "7.0" }
69
+ - { ruby: "3.1", gemfile: 'mongoid_9', mongodb: "7.0" }
70
+ steps:
71
+ - name: Set up MongoDB ${{ matrix.entry.mongodb }}
72
+ uses: supercharge/mongodb-github-action@1.8.0
73
+ with:
74
+ mongodb-version: ${{ matrix.entry.mongodb }}
75
+ - uses: actions/checkout@v3
76
+ - name: Set up Ruby
77
+ uses: ruby/setup-ruby@v1
78
+ with:
79
+ ruby-version: ${{ matrix.entry.ruby }}
80
+ bundler: '2'
81
+ bundler-cache: true
82
+ - name: Run tests
83
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  Gemfile.lock
2
2
  pkg
3
+ gemfiles/*.gemfile.lock
data/.rubocop_todo.yml CHANGED
@@ -11,6 +11,15 @@
11
11
  Metrics/LineLength:
12
12
  Max: 118
13
13
 
14
+ Gemspec/RequiredRubyVersion:
15
+ Exclude:
16
+ - 'mongoid-compatibility.gemspec'
17
+
18
+ Metrics/BlockLength:
19
+ Exclude:
20
+ - 'spec/**/*'
21
+ - 'test/**/*'
22
+
14
23
  # Offense count: 4
15
24
  Style/Documentation:
16
25
  Exclude:
data/Appraisals ADDED
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'mongoid-9' do
4
+ gem 'mongoid', '~> 9.0.0'
5
+ end
6
+
7
+ appraise 'mongoid-8' do
8
+ gem 'mongoid', '~> 8.0.0'
9
+ end
10
+
11
+ appraise 'mongoid-7' do
12
+ gem 'mongoid', '~> 7.0.0'
13
+ end
14
+
15
+ appraise 'mongoid-6' do
16
+ gem 'mongoid', '~> 6.0.2'
17
+ end
18
+
19
+ appraise 'mongoid-5' do
20
+ gem 'mongoid', '~> 5.0.0'
21
+ end
22
+
23
+ appraise 'mongoid-4' do
24
+ gem 'mongoid', '~> 4.0.0'
25
+ end
26
+
27
+ appraise 'mongoid-3' do
28
+ gem 'mongoid', '~> 3.0.0'
29
+ end
30
+
31
+ appraise 'mongoid-2' do
32
+ gem 'mongoid', '~> 2.0.0'
33
+ gem 'bson_ext', platforms: :ruby
34
+ end
data/CHANGELOG.md CHANGED
@@ -1,12 +1,18 @@
1
- ### 0.5.2 (Next)
1
+ ### 1.0.0 (2024/06/19)
2
2
 
3
- * Your contribution here.
3
+ * [#18](https://github.com/mongoid/mongoid-compatibility/pull/18): Test MongoDB 6 and 7 - [@saisrinivasan](https://github.com/SairamSrinivasan).
4
+ * [#16](https://github.com/mongoid/mongoid-compatibility/pull/16): Add support for Mongoid 9 - [@saisrinivasan](https://github.com/SairamSrinivasan).
4
5
 
5
- ### 0.5.1 (2017-12-02)
6
+ ### 0.6.0 (2022/08/18)
7
+
8
+ * [#13](https://github.com/mongoid/mongoid-compatibility/pull/13): Compatibility with Mongoid 8.x - [@joe1chen](https://github.com/joe1chen).
9
+ * [#15](https://github.com/mongoid/mongoid-compatibility/pull/15): Upgraded to mongoid-danger 0.2.0 - [@dblock](https://github.com/dblock).
10
+
11
+ ### 0.5.1 (2017/12/02)
6
12
 
7
13
  * [#8](https://github.com/mongoid/mongoid-compatibility/issues/8): Added `mongoidX_or_newer?` and `mongoidX_or_older?` helpers - [@dblock](https://github.com/dblock).
8
14
 
9
- ### 0.5.0 (2017-09-13)
15
+ ### 0.5.0 (2017/09/13)
10
16
 
11
17
  * [#10](https://github.com/mongoid/mongoid-compatibility/pull/10): Compatibility with Mongoid 7.x - [@joeyAghion](https://github.com/joeyAghion).
12
18
 
data/Dangerfile CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  danger.import_dangerfile(gem: 'mongoid-danger')
data/Gemfile CHANGED
@@ -1,33 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'http://rubygems.org'
2
4
 
3
5
  gemspec
4
-
5
- case version = ENV['MONGOID_VERSION'] || '6.0'
6
- when 'HEAD'
7
- gem 'mongoid', github: 'mongodb/mongoid'
8
- when /^7/
9
- gem 'mongoid', github: 'mongodb/mongoid', branch: '7.0-dev'
10
- when /^6/
11
- gem 'mongoid', '~> 6.0'
12
- when /^5/
13
- gem 'mongoid', '~> 5.0'
14
- when /^4/
15
- gem 'mongoid', '~> 4.0'
16
- when /^3/
17
- gem 'mongoid', '~> 3.1'
18
- when /^2/
19
- gem 'mongoid', '~> 2.0'
20
- gem 'bson_ext', platforms: :ruby
21
- else
22
- gem 'mongoid', version
23
- end
24
-
25
- group :test do
26
- gem 'rspec'
27
- gem 'mongoid-danger', '~> 0.1.1', require: false
28
- end
29
-
30
- group :development do
31
- gem 'rake', '< 12'
32
- gem 'rubocop', '0.33.0'
33
- end
data/Gemfile.danger ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :test do
4
+ gem 'mongoid-danger', '~> 0.2.0', require: false
5
+ end
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2015-2017 Daniel Doubrovkine, Artsy and Contributors
3
+ Copyright (c) 2015-2022 Daniel Doubrovkine, Artsy and Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,11 +2,12 @@ Mongoid::Compatibility
2
2
  =======================
3
3
 
4
4
  [![Gem Version](http://img.shields.io/gem/v/mongoid-compatibility.svg)](http://badge.fury.io/rb/mongoid-compatibility)
5
- [![Build Status](http://img.shields.io/travis/mongoid/mongoid-compatibility.svg)](https://travis-ci.org/mongoid/mongoid-compatibility)
6
- [![Dependency Status](https://gemnasium.com/mongoid/mongoid-compatibility.svg)](https://gemnasium.com/mongoid/mongoid-compatibility)
5
+ [![Build Status](https://github.com/mongoid/mongoid-compatibility/actions/workflows/test.yml/badge.svg)](https://github.com/mongoid/mongoid-compatibility/actions)
7
6
  [![Code Climate](https://codeclimate.com/github/mongoid/mongoid-compatibility.svg)](https://codeclimate.com/github/mongoid/mongoid-compatibility)
8
7
 
9
- Compatibility helpers for Mongoid versions 2, 3, 4, 5, 6 and 7.
8
+ [Tested](https://github.com/mongoid/mongoid-compatibility/actions) against:
9
+ - MRI: `2.6.x`, `2.7.x`, `3.0.x`, `3.1.x`
10
+ - Compatibility helpers for Mongoid versions 2, 3, 4, 5, 6, 7, 8, and 9.
10
11
 
11
12
  ### Install
12
13
 
@@ -40,13 +41,16 @@ Mongoid::Compatibility::Version.mongoid6?
40
41
 
41
42
  Mongoid::Compatibility::Version.mongoid7?
42
43
  # => is this Mongoid 7.x?
44
+
45
+ Mongoid::Compatibility::Version.mongoid8?
46
+ # => is this Mongoid 8.x?
43
47
  ```
44
48
 
45
- Instead of checking for Mongoid 6 and 7, use `newer` and `older` helpers.
49
+ Instead of checking specifically for a specific version, use `newer` and `older` helpers. For example:
46
50
 
47
51
  ``` ruby
48
52
  Mongoid::Compatibility::Version.mongoid6_or_newer?
49
- # => is this Mongoid 6.x or 7.x, including beta 7?
53
+ # => is this Mongoid 6.x or 7.x or 8.x, including beta 8?
50
54
 
51
55
  Mongoid::Compatibility::Version.mongoid5_or_older?
52
56
  # => is this Mongoid 2.x, 3.x, 4.x or 5.x?
@@ -65,6 +69,6 @@ See [CONTRIBUTING](CONTRIBUTING.md).
65
69
 
66
70
  ### Copyright and License
67
71
 
68
- Copyright Daniel Doubrovkine and Contributors, Artsy Inc., 2015-2017
72
+ Copyright Daniel Doubrovkine and Contributors, Artsy Inc., 2015-2022
69
73
 
70
74
  [MIT License](LICENSE.md)
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler/gem_tasks'
3
5
 
@@ -13,4 +15,4 @@ end
13
15
  require 'rubocop/rake_task'
14
16
  RuboCop::RakeTask.new(:rubocop)
15
17
 
16
- task default: [:rubocop, :spec]
18
+ task default: %i[rubocop spec]
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'bson_ext', platforms: :ruby
8
+ gem 'mongoid', '~> 2.0.0'
9
+
10
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', '~> 3.0.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', '~> 4.0.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', '~> 5.0.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', '~> 6.0.2'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', '~> 7.0.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', '~> 8.0.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', '~> 9.0.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'http://rubygems.org'
6
+
7
+ gem 'mongoid', github: 'mongodb/mongoid'
8
+
9
+ group :development do
10
+ gem 'appraisal', '~> 2.0'
11
+ gem 'rake', '< 12'
12
+ gem 'rubocop', '0.33.0'
13
+ end
14
+
15
+ group :test do
16
+ gem 'rspec'
17
+ end
18
+
19
+ gemspec path: '../'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mongoid
2
4
  module Compatibility
3
5
  module ObjectId
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mongoid
2
4
  module Compatibility
3
- VERSION = '0.5.1'.freeze
5
+ VERSION = '1.0.0'
4
6
  end
5
7
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Mongoid
2
4
  module Compatibility
3
5
  module Version
4
6
  module ClassMethods
5
- (2..7).each do |v|
7
+ (2..9).each do |v|
6
8
  const_set "V#{v}", Mongoid::VERSION =~ Regexp.new("^#{v}\.")
7
9
 
8
10
  define_method "mongoid#{v}?" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mongoid'
2
4
  require 'mongoid/compatibility/self'
3
5
  require 'mongoid/compatibility/version'
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mongoid/compatibility'
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'mongoid-compatibility'
@@ -1,4 +1,6 @@
1
- $LOAD_PATH.push File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
4
  require 'mongoid/compatibility/self'
3
5
 
4
6
  Gem::Specification.new do |s|
@@ -13,6 +15,12 @@ Gem::Specification.new do |s|
13
15
  s.homepage = 'http://github.com/mongoid/mongoid-compatibility'
14
16
  s.licenses = ['MIT']
15
17
  s.summary = 'Compatibility helpers for Mongoid.'
16
- s.add_dependency 'mongoid', '>= 2.0'
17
18
  s.add_dependency 'activesupport'
19
+ s.add_dependency 'mongoid', '>= 2.0'
20
+
21
+ s.add_development_dependency 'appraisal', '~> 2.0'
22
+ s.add_development_dependency 'mongoid-danger', '~> 0.2'
23
+ s.add_development_dependency 'rake', '< 12'
24
+ s.add_development_dependency 'rspec'
25
+ s.add_development_dependency 'rubocop', '~> 1.36.0'
18
26
  end
@@ -0,0 +1,8 @@
1
+ test:
2
+ clients:
3
+ default:
4
+ database: mongoid-compatibility
5
+ hosts:
6
+ - localhost:27017
7
+ options:
8
+ raise_not_found_error: false
@@ -0,0 +1,8 @@
1
+ test:
2
+ clients:
3
+ default:
4
+ database: mongoid-compatibility
5
+ hosts:
6
+ - localhost:27017
7
+ options:
8
+ raise_not_found_error: false
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Mongoid::Compatibility::ObjectId do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Mongoid::Compatibility do
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Mongoid::Compatibility::Version do
4
6
  context 'mongoid? methods' do
5
7
  it 'only true for one version' do
6
- expect((2..7).one? do |v|
8
+ expect((2..9).one? do |v|
7
9
  Mongoid::Compatibility::Version.send("mongoid#{v}?")
8
10
  end).to be true
9
11
  end
@@ -31,10 +33,10 @@ describe Mongoid::Compatibility::Version do
31
33
  expect(Mongoid::Compatibility::Version.send("mongoid#{version}_or_older?")).to be true
32
34
  end
33
35
  end
34
- (2..7).each do |v|
36
+ (2..9).each do |v|
35
37
  context "mongoid #{v}" do
36
38
  before do
37
- stub_const('::Mongoid::VERSION', "#{v}")
39
+ stub_const('::Mongoid::VERSION', v.to_s)
38
40
  stub_const("::Mongoid::Compatibility::Version::ClassMethods::V#{v}", 1)
39
41
  end
40
42
  it "responds to mongoid#{v}?" do
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ ENV['MONGOID_ENV'] = 'test'
4
+
1
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
6
 
3
7
  require 'rubygems'
@@ -1,4 +1,4 @@
1
- ENV['MONGOID_ENV'] = 'test'
1
+ # frozen_string_literal: true
2
2
 
3
3
  if Mongoid::Compatibility::Version.mongoid2?
4
4
  Mongoid.load! 'spec/config/mongoid2.yml'
@@ -12,8 +12,12 @@ elsif Mongoid::Compatibility::Version.mongoid6?
12
12
  Mongoid.load! 'spec/config/mongoid6.yml'
13
13
  elsif Mongoid::Compatibility::Version.mongoid7?
14
14
  Mongoid.load! 'spec/config/mongoid7.yml'
15
+ elsif Mongoid::Compatibility::Version.mongoid8?
16
+ Mongoid.load! 'spec/config/mongoid8.yml'
17
+ elsif Mongoid::Compatibility::Version.mongoid9?
18
+ Mongoid.load! 'spec/config/mongoid9.yml'
15
19
  else
16
- fail "unsupported Mongoid version #{Mongoid::VERSION}"
20
+ raise "unsupported Mongoid version #{Mongoid::VERSION}"
17
21
  end
18
22
 
19
23
  RSpec.configure do |config|
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-compatibility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-03 00:00:00.000000000 Z
11
+ date: 2024-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: mongoid
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,38 +39,107 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: '2.0'
27
41
  - !ruby/object:Gem::Dependency
28
- name: activesupport
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mongoid-danger
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "<"
74
+ - !ruby/object:Gem::Version
75
+ version: '12'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: '12'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
29
85
  requirement: !ruby/object:Gem::Requirement
30
86
  requirements:
31
87
  - - ">="
32
88
  - !ruby/object:Gem::Version
33
89
  version: '0'
34
- type: :runtime
90
+ type: :development
35
91
  prerelease: false
36
92
  version_requirements: !ruby/object:Gem::Requirement
37
93
  requirements:
38
94
  - - ">="
39
95
  - !ruby/object:Gem::Version
40
96
  version: '0'
41
- description:
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.36.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.36.0
111
+ description:
42
112
  email: dblock@dblock.org
43
113
  executables: []
44
114
  extensions: []
45
115
  extra_rdoc_files: []
46
116
  files:
117
+ - ".github/workflows/danger.yml"
118
+ - ".github/workflows/rubocop.yml"
119
+ - ".github/workflows/test.yml"
47
120
  - ".gitignore"
48
121
  - ".rspec"
49
122
  - ".rubocop.yml"
50
123
  - ".rubocop_todo.yml"
51
- - ".travis.yml"
124
+ - Appraisals
52
125
  - CHANGELOG.md
53
126
  - CONTRIBUTING.md
54
127
  - Dangerfile
55
128
  - Gemfile
129
+ - Gemfile.danger
56
130
  - LICENSE.md
57
131
  - README.md
58
132
  - RELEASING.md
59
133
  - Rakefile
134
+ - gemfiles/mongoid_2.gemfile
135
+ - gemfiles/mongoid_3.gemfile
136
+ - gemfiles/mongoid_4.gemfile
137
+ - gemfiles/mongoid_5.gemfile
138
+ - gemfiles/mongoid_6.gemfile
139
+ - gemfiles/mongoid_7.gemfile
140
+ - gemfiles/mongoid_8.gemfile
141
+ - gemfiles/mongoid_9.gemfile
142
+ - gemfiles/mongoid_head.gemfile
60
143
  - lib/mongoid-compatibility.rb
61
144
  - lib/mongoid/compatibility.rb
62
145
  - lib/mongoid/compatibility/object_id.rb
@@ -70,6 +153,8 @@ files:
70
153
  - spec/config/mongoid5.yml
71
154
  - spec/config/mongoid6.yml
72
155
  - spec/config/mongoid7.yml
156
+ - spec/config/mongoid8.yml
157
+ - spec/config/mongoid9.yml
73
158
  - spec/mongoid/compatibility/object_id_spec.rb
74
159
  - spec/mongoid/compatibility/self_spec.rb
75
160
  - spec/mongoid/compatibility/version_spec.rb
@@ -79,7 +164,7 @@ homepage: http://github.com/mongoid/mongoid-compatibility
79
164
  licenses:
80
165
  - MIT
81
166
  metadata: {}
82
- post_install_message:
167
+ post_install_message:
83
168
  rdoc_options: []
84
169
  require_paths:
85
170
  - lib
@@ -94,9 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
179
  - !ruby/object:Gem::Version
95
180
  version: 1.3.6
96
181
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.5.2
99
- signing_key:
182
+ rubygems_version: 3.5.10
183
+ signing_key:
100
184
  specification_version: 4
101
185
  summary: Compatibility helpers for Mongoid.
102
186
  test_files: []
data/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- services:
2
- - mongodb
3
-
4
- matrix:
5
- include:
6
- - rvm: 2.3.1
7
- script:
8
- - bundle exec danger
9
- - rvm: 2.4.0
10
- env:
11
- - MONGOID_VERSION=7
12
- - rvm: 2.4.0
13
- env:
14
- - MONGOID_VERSION=6
15
- - rvm: 2.3.1
16
- env:
17
- - MONGOID_VERSION=6
18
- - rvm: 2.3.1
19
- env:
20
- - MONGOID_VERSION=5
21
- - rvm: 2.3.1
22
- env:
23
- - MONGOID_VERSION=4
24
- - rvm: 2.3.1
25
- env:
26
- - MONGOID_VERSION=3
27
- - rvm: 2.3.1
28
- env:
29
- - MONGOID_VERSION=2
30
- - rvm: 2.3.1
31
- env:
32
- - MONGOID_VERSION=HEAD
33
- - rvm: 2.3.0