mongoid-compatibility 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96242e8dafcc50fb30c71364aaa0ae2e4fef1dc0a4fb1b53dacd7e6a05633ddd
4
- data.tar.gz: 9bacbead3c2d71b3127b63afacb54a79da599fd8eb5616764ee4e70ae1beaf72
3
+ metadata.gz: f5c1b4338102dbc896ae63882a6f630426d2e3d4facef001d6c7b2b36c4d4c96
4
+ data.tar.gz: a7fa288890bd1d597228d6b015ef8293ec9c1c78c2a62bab697b49c4bd300d8c
5
5
  SHA512:
6
- metadata.gz: c5ab33ff6bf40cce9fb20c666af1d660cd9730225f592bc552c9c81a0b2b111cc3e68a7b5c051498aa529f9df7a60e01e2738b8b8cc038a8f373ad6b758f4463
7
- data.tar.gz: 5c882b1b39c3b3c66d1a2e2527f7d211607cf83be373066fe9da70977611aab34dcbcd0a4ce3fffd76c9c2e708bfc4e9aeaeb396fe7c5f6bdb0a128c6eca737e
6
+ metadata.gz: 3eb4ff2240106bd8998ebf7210a48e270a68393015b985005372d4df3c639ec3d29939bfd4d6f1e04b849906a3b3a1bfaecf1cfbe033f1735e2b21fab9c5d523
7
+ data.tar.gz: bf7af92da3ff937c1fea260d16a5b57f417179c053a32c28a693881580ecfd0ada33894f52b2c3635248ac159ccebe64a6eeb35f3c602e18205c125dd49988d4
@@ -0,0 +1,11 @@
1
+ name: Danger Comment
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: [Danger]
6
+ types: [completed]
7
+
8
+ jobs:
9
+ comment:
10
+ uses: numbata/danger-pr-comment/.github/workflows/danger-comment.yml@v0.1.0
11
+ secrets: inherit
@@ -1,17 +1,13 @@
1
- name: PR Linter
2
- on: [pull_request]
1
+ name: Danger
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, reopened, edited, synchronize]
6
+
3
7
  jobs:
4
8
  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
9
+ uses: numbata/danger-pr-comment/.github/workflows/danger-run.yml@v0.1.0
10
+ secrets: inherit
11
+ with:
12
+ ruby-version: '2.7'
13
+ bundler-cache: true
@@ -4,7 +4,7 @@ jobs:
4
4
  lint:
5
5
  runs-on: ubuntu-latest
6
6
  steps:
7
- - uses: actions/checkout@v2
7
+ - uses: actions/checkout@v6
8
8
  - name: Set up Ruby
9
9
  uses: ruby/setup-ruby@v1
10
10
  with:
@@ -4,80 +4,46 @@ on: [push, pull_request]
4
4
 
5
5
  jobs:
6
6
  build:
7
- name: >-
8
- Mongoid Test with: - Ruby ${{ matrix.entry.ruby }} - MongoDB ${{ matrix.entry.mongodb }} - Gemfile ${{ matrix.entry.gemfile }})
7
+ name: Ruby ${{ matrix.entry.ruby }} / Mongoid ${{ matrix.entry.mongoid }} / MongoDB ${{ matrix.entry.mongodb }}
8
+ runs-on: ubuntu-latest
9
9
  env:
10
10
  CI: true
11
- TESTOPTS: "-v"
12
- BUNDLE_GEMFILE: gemfiles/${{ matrix.entry.gemfile }}.gemfile
13
- runs-on: ubuntu-latest
14
- continue-on-error: false
11
+ COVERAGE: ${{ matrix.entry.coverage }}
12
+ BUNDLE_GEMFILE: gemfiles/mongoid_${{ matrix.entry.mongoid }}.gemfile
15
13
  strategy:
14
+ fail-fast: false
16
15
  matrix:
17
16
  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" }
17
+ - { ruby: '2.6', mongoid: '3', mongodb: '3.6' }
18
+ - { ruby: '2.6', mongoid: '4', mongodb: '3.6' }
19
+ - { ruby: '2.6', mongoid: '5', mongodb: '3.6' }
20
+ - { ruby: '2.6', mongoid: '6', mongodb: '4.0' }
21
+ - { ruby: '2.6', mongoid: '7', mongodb: '4.2' }
22
+ - { ruby: '2.7', mongoid: '7', mongodb: '4.4' }
23
+ - { ruby: '3.0', mongoid: '8', mongodb: '5.0' }
24
+ - { ruby: '3.1', mongoid: '8', mongodb: '6.0' }
25
+ - { ruby: '3.1', mongoid: '9', mongodb: '5.0' }
26
+ - { ruby: '3.2', mongoid: '9', mongodb: '7.0' }
27
+ - { ruby: '3.3', mongoid: '9', mongodb: '8.0' }
28
+ - { ruby: '3.4', mongoid: '9', mongodb: '8.0', coverage: true }
29
+ - { ruby: '4.0', mongoid: '9', mongodb: '8.0' }
70
30
  steps:
71
- - name: Set up MongoDB ${{ matrix.entry.mongodb }}
72
- uses: supercharge/mongodb-github-action@1.8.0
31
+ - uses: actions/checkout@v6
32
+ - name: Set up MongoDB
33
+ uses: supercharge/mongodb-github-action@1.12.1
73
34
  with:
74
35
  mongodb-version: ${{ matrix.entry.mongodb }}
75
- - uses: actions/checkout@v3
76
36
  - name: Set up Ruby
77
37
  uses: ruby/setup-ruby@v1
78
38
  with:
79
39
  ruby-version: ${{ matrix.entry.ruby }}
80
- bundler: '2'
81
40
  bundler-cache: true
82
41
  - name: Run tests
83
- run: bundle exec rake
42
+ run: bundle exec rake spec
43
+ - name: Coveralls
44
+ if: matrix.entry.coverage
45
+ uses: coverallsapp/github-action@v2
46
+ with:
47
+ github-token: ${{ secrets.GITHUB_TOKEN }}
48
+ file: coverage/.resultset.json
49
+ format: simplecov
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  Gemfile.lock
2
2
  pkg
3
- gemfiles/*.gemfile.lock
3
+ gemfiles/*.gemfile.lock
4
+ coverage/
data/.rubocop.yml CHANGED
@@ -1,5 +1,10 @@
1
1
  AllCops:
2
+ NewCops: enable
2
3
  Exclude:
3
4
  - vendor/**/*
4
5
 
5
6
  inherit_from: .rubocop_todo.yml
7
+
8
+ require:
9
+ - rubocop-rake
10
+ - rubocop-rspec
data/.rubocop_todo.yml CHANGED
@@ -1,39 +1,63 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-09-13 14:18:39 -0400 using RuboCop version 0.33.0.
3
+ # on 2026-01-02 19:41:49 UTC using RuboCop version 1.36.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 20
10
- # Configuration parameters: AllowURI, URISchemes.
11
- Metrics/LineLength:
12
- Max: 118
13
-
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
14
12
  Gemspec/RequiredRubyVersion:
15
13
  Exclude:
16
14
  - 'mongoid-compatibility.gemspec'
17
15
 
18
- Metrics/BlockLength:
16
+ # Offense count: 1
17
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
18
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
19
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
20
+ Naming/FileName:
19
21
  Exclude:
20
- - 'spec/**/*'
21
- - 'test/**/*'
22
+ - 'lib/mongoid-compatibility.rb'
22
23
 
23
- # Offense count: 4
24
- Style/Documentation:
24
+ # Offense count: 1
25
+ # Configuration parameters: Prefixes, AllowedPatterns.
26
+ # Prefixes: when, with, without
27
+ RSpec/ContextWording:
25
28
  Exclude:
26
- - 'lib/mongoid/compatibility/object_id.rb'
27
- - 'lib/mongoid/compatibility/self.rb'
28
- - 'lib/mongoid/compatibility/version.rb'
29
+ - 'spec/mongoid/compatibility/version_spec.rb'
30
+
31
+ # Offense count: 18
32
+ # This cop supports unsafe autocorrection (--autocorrect-all).
33
+ # Configuration parameters: SkipBlocks, EnforcedStyle.
34
+ # SupportedStyles: described_class, explicit
35
+ RSpec/DescribedClass:
36
+ Exclude:
37
+ - 'spec/mongoid/compatibility/object_id_spec.rb'
38
+ - 'spec/mongoid/compatibility/version_spec.rb'
39
+
40
+ # Offense count: 1
41
+ # Configuration parameters: CountAsOne.
42
+ RSpec/ExampleLength:
43
+ Max: 13
29
44
 
30
45
  # Offense count: 1
31
- Style/DoubleNegation:
46
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
47
+ # Include: **/*_spec*rb*, **/spec/**/*
48
+ RSpec/FilePath:
32
49
  Exclude:
33
- - 'lib/mongoid/compatibility/version.rb'
50
+ - 'spec/mongoid/compatibility/self_spec.rb'
34
51
 
35
52
  # Offense count: 1
36
- # Configuration parameters: Exclude.
37
- Style/FileName:
53
+ RSpec/MultipleExpectations:
54
+ Max: 5
55
+
56
+ # Offense count: 3
57
+ # Configuration parameters: AllowedConstants.
58
+ Style/Documentation:
38
59
  Exclude:
39
- - 'lib/mongoid-compatibility.rb'
60
+ - 'spec/**/*'
61
+ - 'test/**/*'
62
+ - 'lib/mongoid/compatibility/object_id.rb'
63
+ - 'lib/mongoid/compatibility/version.rb'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 1.1.0 (2026/10/18)
2
+ * [#24](https://github.com/mongoid/mongoid-compatibility/pull/24): Cover supported require aliases and the public gem version - [@dblock](https://github.com/dblock).
3
+ * [#23](https://github.com/mongoid/mongoid-compatibility/pull/23): Replace Code Climate with SimpleCov and Coveralls reporting in CI and update status badges - [@dblock](https://github.com/dblock).
4
+ * [#22](https://github.com/mongoid/mongoid-compatibility/pull/22): Modernize CI with representative MongoDB 3.6–8.0, Mongoid 3–9, and Ruby 2.6–4.0 coverage - [@dblock](https://github.com/dblock).
5
+ * [#21](https://github.com/mongoid/mongoid-compatibility/pull/21): Migrate Danger to use danger-pr-comment workflow - [@dblock](https://github.com/dblock).
6
+ * [#20](https://github.com/mongoid/mongoid-compatibility/pull/20): Add gem caching to CI - [@saisrinivasan](https://github.com/SairamSrinivasan).
7
+
1
8
  ### 1.0.0 (2024/06/19)
2
9
 
3
10
  * [#18](https://github.com/mongoid/mongoid-compatibility/pull/18): Test MongoDB 6 and 7 - [@saisrinivasan](https://github.com/SairamSrinivasan).
data/Dangerfile CHANGED
@@ -1,3 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- danger.import_dangerfile(gem: 'mongoid-danger')
3
+ danger.import_dangerfile(gem: 'danger-pr-comment')
4
+
5
+ changelog.check!
data/Gemfile CHANGED
@@ -3,3 +3,9 @@
3
3
  source 'http://rubygems.org'
4
4
 
5
5
  gemspec
6
+
7
+ group :test do
8
+ gem 'danger', require: false
9
+ gem 'danger-changelog', require: false
10
+ gem 'danger-pr-comment', require: false
11
+ end
data/README.md CHANGED
@@ -2,8 +2,10 @@ 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](https://github.com/mongoid/mongoid-compatibility/actions/workflows/test.yml/badge.svg)](https://github.com/mongoid/mongoid-compatibility/actions)
6
- [![Code Climate](https://codeclimate.com/github/mongoid/mongoid-compatibility.svg)](https://codeclimate.com/github/mongoid/mongoid-compatibility)
5
+ [![Build Status](https://github.com/mongoid/mongoid-compatibility/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/mongoid/mongoid-compatibility/actions/workflows/test.yml?query=branch%3Amaster)
6
+ [![Coverage Status](https://coveralls.io/repos/github/mongoid/mongoid-compatibility/badge.svg?branch=master)](https://coveralls.io/github/mongoid/mongoid-compatibility?branch=master)
7
+
8
+ CI collects SimpleCov coverage on Ruby 3.4 with Mongoid 9 and MongoDB 8.0 and submits one report to Coveralls using GitHub's workflow token. To generate a local report, run `COVERAGE=true BUNDLE_GEMFILE=gemfiles/mongoid_9.gemfile bundle install` followed by `COVERAGE=true BUNDLE_GEMFILE=gemfiles/mongoid_9.gemfile bundle exec rake spec`. Reports are written to `coverage/`.
7
9
 
8
10
  [Tested](https://github.com/mongoid/mongoid-compatibility/actions) against:
9
11
  - MRI: `2.6.x`, `2.7.x`, `3.0.x`, `3.1.x`
data/RELEASING.md CHANGED
@@ -10,7 +10,7 @@ Generally, `mongoid-compatibility` should be released with enthusiasm but care.
10
10
  rake
11
11
  ```
12
12
 
13
- 2. Run the test suite on [Travis](https://travis-ci.org) to be certain that your changes work in a variety of environments. Only merge and release when all tests are passing.
13
+ 2. Wait for the release preparation commit's [GitHub Actions](https://github.com/mongoid/mongoid-compatibility/actions) checks to pass before publishing.
14
14
 
15
15
  3. Bump the version in [`lib/mongoid/compatibility/self.rb`](lib/mongoid/compatibility/self.rb).
16
16
 
@@ -41,3 +41,22 @@ Generally, `mongoid-compatibility` should be released with enthusiasm but care.
41
41
  #=> Pushed git commits and tags.
42
42
  #=> Pushed mongoid-compatibility 0.4.0 to rubygems.org.
43
43
  ```
44
+ ## Prepare for the Next Version
45
+
46
+ Add the next release to [CHANGELOG.md](CHANGELOG.md).
47
+
48
+ ```
49
+ ### 1.1.1 (Next)
50
+
51
+ * Your contribution here.
52
+ ```
53
+
54
+ Increment the development patch version in [lib/mongoid/compatibility/self.rb](lib/mongoid/compatibility/self.rb).
55
+
56
+ Commit your changes.
57
+
58
+ ```
59
+ git add CHANGELOG.md lib/mongoid/compatibility/self.rb
60
+ git commit -m "Setting up next release, 1.1.1."
61
+ git push origin master
62
+ ```
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mongoid
4
4
  module Compatibility
5
- VERSION = '1.0.0'
5
+ VERSION = '1.1.0'
6
6
  end
7
7
  end
@@ -19,8 +19,12 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency 'mongoid', '>= 2.0'
20
20
 
21
21
  s.add_development_dependency 'appraisal', '~> 2.0'
22
- s.add_development_dependency 'mongoid-danger', '~> 0.2'
23
- s.add_development_dependency 'rake', '< 12'
22
+ s.add_development_dependency 'ostruct'
23
+ s.add_development_dependency 'rake'
24
24
  s.add_development_dependency 'rspec'
25
25
  s.add_development_dependency 'rubocop', '~> 1.36.0'
26
+ s.add_development_dependency 'rubocop-rake'
27
+ s.add_development_dependency 'rubocop-rspec'
28
+ s.add_development_dependency 'simplecov', '~> 0.22' if ENV['COVERAGE'] == 'true'
29
+ s.metadata['rubygems_mfa_required'] = 'true'
26
30
  end
@@ -6,6 +6,7 @@ describe Mongoid::Compatibility::ObjectId do
6
6
  it 'valid' do
7
7
  expect(Mongoid::Compatibility::ObjectId.legal?('4e4d66343b39b68407000001')).to be true
8
8
  end
9
+
9
10
  it 'invalid' do
10
11
  expect(Mongoid::Compatibility::ObjectId.legal?('asadsf')).to be false
11
12
  end
@@ -9,11 +9,14 @@ describe Mongoid::Compatibility::Version do
9
9
  Mongoid::Compatibility::Version.send("mongoid#{v}?")
10
10
  end).to be true
11
11
  end
12
+
12
13
  context "current version #{Mongoid::VERSION}" do
13
14
  let(:version) { Mongoid::VERSION.split('.').first.to_i }
15
+
14
16
  it 'mongoidX?' do
15
17
  expect(Mongoid::Compatibility::Version.send("mongoid#{version}?")).to be true
16
18
  end
19
+
17
20
  it 'mongoidX?_or_newer?' do
18
21
  expect(Mongoid::Compatibility::Version.send("mongoid#{version}_or_newer?")).to be true
19
22
  if Mongoid::Compatibility::Version.respond_to?("mongoid#{version - 1}_or_newer?")
@@ -29,25 +32,31 @@ describe Mongoid::Compatibility::Version do
29
32
  expect(Mongoid::Compatibility::Version.send("mongoid#{version + 1}_or_newer?")).to be false
30
33
  end
31
34
  end
35
+
32
36
  it 'mongoidX?_or_older?' do
33
37
  expect(Mongoid::Compatibility::Version.send("mongoid#{version}_or_older?")).to be true
34
38
  end
35
39
  end
40
+
36
41
  (2..9).each do |v|
37
42
  context "mongoid #{v}" do
38
43
  before do
39
44
  stub_const('::Mongoid::VERSION', v.to_s)
40
45
  stub_const("::Mongoid::Compatibility::Version::ClassMethods::V#{v}", 1)
41
46
  end
47
+
42
48
  it "responds to mongoid#{v}?" do
43
49
  expect(Mongoid::Compatibility::Version).to respond_to("mongoid#{v}?")
44
50
  end
51
+
45
52
  it "mongoid#{v}?" do
46
53
  expect(Mongoid::Compatibility::Version.send("mongoid#{v}?")).to be true
47
54
  end
55
+
48
56
  it "mongoid#{v}_or_newer?" do
49
57
  expect(Mongoid::Compatibility::Version.send("mongoid#{v}_or_newer?")).to be true
50
58
  end
59
+
51
60
  it "mongoid#{v}_or_older?" do
52
61
  expect(Mongoid::Compatibility::Version.send("mongoid#{v}_or_older?")).to be true
53
62
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Mongoid::Compatibility do
6
+ it 'loads the hyphenated and underscored compatibility entry points' do
7
+ require 'mongoid-compatibility'
8
+ require 'mongoid_compatibility'
9
+
10
+ expect(Mongoid::Compatibility::Version).to respond_to(:mongoid9?)
11
+ expect(Mongoid::Compatibility::ObjectId).to respond_to(:legal?)
12
+ end
13
+
14
+ it 'defines a semantic gem version' do
15
+ expect(Mongoid::Compatibility::VERSION).to match(/\A\d+\.\d+\.\d+\z/)
16
+ end
17
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ if ENV['COVERAGE'] == 'true'
4
+ require 'simplecov'
5
+ SimpleCov.start do
6
+ add_filter '/spec/'
7
+ track_files 'lib/**/*.rb'
8
+ end
9
+ end
10
+
3
11
  ENV['MONGOID_ENV'] = 'test'
4
12
 
5
13
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
14
 
15
+ require 'logger'
7
16
  require 'rubygems'
8
17
  require 'rspec'
9
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-compatibility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-25 00:00:00.000000000 Z
11
+ date: 2026-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -53,33 +53,33 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: mongoid-danger
56
+ name: ostruct
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.2'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0.2'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "<"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '12'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "<"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '12'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -108,12 +108,41 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.36.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
111
139
  description:
112
140
  email: dblock@dblock.org
113
141
  executables: []
114
142
  extensions: []
115
143
  extra_rdoc_files: []
116
144
  files:
145
+ - ".github/workflows/danger-comment.yml"
117
146
  - ".github/workflows/danger.yml"
118
147
  - ".github/workflows/rubocop.yml"
119
148
  - ".github/workflows/test.yml"
@@ -158,12 +187,14 @@ files:
158
187
  - spec/mongoid/compatibility/object_id_spec.rb
159
188
  - spec/mongoid/compatibility/self_spec.rb
160
189
  - spec/mongoid/compatibility/version_spec.rb
190
+ - spec/mongoid/compatibility_entry_points_spec.rb
161
191
  - spec/spec_helper.rb
162
192
  - spec/support/mongoid.rb
163
193
  homepage: http://github.com/mongoid/mongoid-compatibility
164
194
  licenses:
165
195
  - MIT
166
- metadata: {}
196
+ metadata:
197
+ rubygems_mfa_required: 'true'
167
198
  post_install_message:
168
199
  rdoc_options: []
169
200
  require_paths:
@@ -179,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
210
  - !ruby/object:Gem::Version
180
211
  version: 1.3.6
181
212
  requirements: []
182
- rubygems_version: 3.5.10
213
+ rubygems_version: 3.5.16
183
214
  signing_key:
184
215
  specification_version: 4
185
216
  summary: Compatibility helpers for Mongoid.