mongoid-compatibility 0.5.1 → 0.6.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: 67f56f2a4f261301d9ce8856177e0dc45dd0f490fffe58842cc65814cbc039b8
4
+ data.tar.gz: 603268d9a0f89b086f0d239d75289edfdb0948a653050e54e8c6811e97992628
5
5
  SHA512:
6
- metadata.gz: 7b2cd8310aad4d88c0ec2ca8257adf4e943752e046a1c8ca96eaf65589b94212a261847815dbe6c38a1c319288519fc6a0717219037850339798aba5e815e136
7
- data.tar.gz: e1898cb7f37f293c6559d7614ab4b941c04205184b9a5ce3b49889ffeeeddbcac4bfe184844110d6df046bb78e9ef25a12815dcb70e09eaa287a053b89197bae
6
+ metadata.gz: 91fd9d67679f2c7226dbde61790bb17640c0e8a2292f42251fadc0a507b1e96212c112dd8cbd1c23606a4316dd79d761a3e47205092dc1e3b49281f7244b88fc
7
+ data.tar.gz: 9c0ce0c31f6191162ce82cbb7685aa288015f9fb25aa48b0546761f4160d9dcb92563791711ad3559eae126bf0e93a302235b9b1730b4103126bc74d8e9b9056
@@ -0,0 +1,19 @@
1
+ name: PR Linter
2
+ on: [pull_request]
3
+ jobs:
4
+ danger:
5
+ runs-on: ubuntu-latest
6
+ env:
7
+ BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile.danger
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ with:
11
+ fetch-depth: 0
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: 2.6
15
+ bundler-cache: true
16
+ - run: |
17
+ # the personal token is public, this is ok, base64 encode to avoid tripping Github
18
+ TOKEN=$(echo -n NWY1ZmM5MzEyMzNlYWY4OTZiOGU3MmI3MWQ3Mzk0MzgxMWE4OGVmYwo= | base64 --decode)
19
+ 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,80 @@
1
+ name: CI RSpec Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name: >-
8
+ Mongoid ${{ matrix.entry.mongoid }} - Ruby ${{ matrix.entry.ruby }} - MongoDB ${{ matrix.entry.mongodb }}
9
+ env:
10
+ CI: true
11
+ TESTOPTS: -v
12
+ runs-on: ubuntu-latest
13
+ continue-on-error: false
14
+ strategy:
15
+ matrix:
16
+ entry:
17
+ - { ruby: "2.1", mongoid: "3", bundler: "1", mongodb: "3.6" }
18
+ - { ruby: "2.1", mongoid: "4", bundler: "1", mongodb: "3.6" }
19
+ - { ruby: "2.2", mongoid: "4", bundler: "2", mongodb: "3.6" }
20
+ - { ruby: "2.2", mongoid: "5", bundler: "2", mongodb: "3.6" }
21
+ - { ruby: "2.3", mongoid: "5", bundler: "2", mongodb: "3.6" }
22
+ - { ruby: "2.4", mongoid: "6.1", bundler: "2", mongodb: "3.6" }
23
+ - { ruby: "2.5", mongoid: "6.2", bundler: "2", mongodb: "3.6" }
24
+ - { ruby: "2.5", mongoid: "6.4", bundler: "2", mongodb: "3.6" }
25
+ - { ruby: "2.6", mongoid: "7.4", bundler: "2", mongodb: "3.6" }
26
+ - { ruby: "2.6", mongoid: "7.5", bundler: "2", mongodb: "3.6" }
27
+ - { ruby: "2.7", mongoid: "7.5", bundler: "2", mongodb: "3.6" }
28
+ - { ruby: "3.0", mongoid: "8.0", bundler: "2", mongodb: "3.6" }
29
+ - { ruby: "3.1", mongoid: "8.0", bundler: "2", mongodb: "3.6" }
30
+ - { ruby: "2.5", mongoid: "6.4", bundler: "2", mongodb: "4.0" }
31
+ - { ruby: "2.6", mongoid: "7.4", bundler: "2", mongodb: "4.0" }
32
+ - { ruby: "2.6", mongoid: "7.5", bundler: "2", mongodb: "4.0" }
33
+ - { ruby: "2.7", mongoid: "7.5", bundler: "2", mongodb: "4.0" }
34
+ - { ruby: "3.0", mongoid: "8.0", bundler: "2", mongodb: "4.0" }
35
+ - { ruby: "3.1", mongoid: "8.0", bundler: "2", mongodb: "4.0" }
36
+ - { ruby: "2.5", mongoid: "6.4", bundler: "2", mongodb: "4.2" }
37
+ - { ruby: "2.6", mongoid: "7.4", bundler: "2", mongodb: "4.2" }
38
+ - { ruby: "2.6", mongoid: "7.5", bundler: "2", mongodb: "4.2" }
39
+ - { ruby: "2.7", mongoid: "7.5", bundler: "2", mongodb: "4.2" }
40
+ - { ruby: "3.0", mongoid: "8.0", bundler: "2", mongodb: "4.2" }
41
+ - { ruby: "3.1", mongoid: "8.0", bundler: "2", mongodb: "4.2" }
42
+ - { ruby: "2.5", mongoid: "6.4", bundler: "2", mongodb: "4.4" }
43
+ - { ruby: "2.6", mongoid: "7.4", bundler: "2", mongodb: "4.4" }
44
+ - { ruby: "2.6", mongoid: "7.5", bundler: "2", mongodb: "4.4" }
45
+ - { ruby: "2.7", mongoid: "7.5", bundler: "2", mongodb: "4.4" }
46
+ - { ruby: "3.0", mongoid: "8.0", bundler: "2", mongodb: "4.4" }
47
+ - { ruby: "3.1", mongoid: "8.0", bundler: "2", mongodb: "4.4" }
48
+ - { ruby: "2.5", mongoid: "6.4", bundler: "2", mongodb: "5.0" }
49
+ - { ruby: "2.6", mongoid: "7.4", bundler: "2", mongodb: "5.0" }
50
+ - { ruby: "2.6", mongoid: "7.5", bundler: "2", mongodb: "5.0" }
51
+ - { ruby: "2.7", mongoid: "7.5", bundler: "2", mongodb: "5.0" }
52
+ - { ruby: "3.0", mongoid: "8.0", bundler: "2", mongodb: "5.0" }
53
+ - { ruby: "3.1", mongoid: "8.0", bundler: "2", mongodb: "5.0" }
54
+ steps:
55
+ - name: repo checkout
56
+ uses: actions/checkout@v2
57
+
58
+ - name: start mongodb
59
+ uses: supercharge/mongodb-github-action@1.6.0
60
+ with:
61
+ mongodb-version: ${{ matrix.entry.mongodb }}
62
+ mongodb-replica-set: rs0
63
+
64
+ - name: load ruby
65
+ uses: ruby/setup-ruby@v1
66
+ with:
67
+ ruby-version: ${{ matrix.entry.ruby }}
68
+ bundler: ${{ matrix.entry.bundler }}
69
+
70
+ - name: bundle install
71
+ run: bundle install --jobs 4 --retry 3
72
+ env:
73
+ MONGOID_VERSION: ${{ matrix.entry.mongoid }}
74
+
75
+ - name: test
76
+ timeout-minutes: 10
77
+ run: bundle exec rspec spec
78
+ continue-on-error: false
79
+ env:
80
+ MONGOID_VERSION: ${{ matrix.entry.mongoid }}
data/CHANGELOG.md CHANGED
@@ -1,12 +1,13 @@
1
- ### 0.5.2 (Next)
1
+ ### 0.6.0 (2022/08/18)
2
2
 
3
- * Your contribution here.
3
+ * [#13](https://github.com/mongoid/mongoid-compatibility/pull/13): Compatibility with Mongoid 8.x - [@joe1chen](https://github.com/joe1chen).
4
+ * [#15](https://github.com/mongoid/mongoid-compatibility/pull/15): Upgraded to mongoid-danger 0.2.0 - [@dblock](https://github.com/dblock).
4
5
 
5
- ### 0.5.1 (2017-12-02)
6
+ ### 0.5.1 (2017/12/02)
6
7
 
7
8
  * [#8](https://github.com/mongoid/mongoid-compatibility/issues/8): Added `mongoidX_or_newer?` and `mongoidX_or_older?` helpers - [@dblock](https://github.com/dblock).
8
9
 
9
- ### 0.5.0 (2017-09-13)
10
+ ### 0.5.0 (2017/09/13)
10
11
 
11
12
  * [#10](https://github.com/mongoid/mongoid-compatibility/pull/10): Compatibility with Mongoid 7.x - [@joeyAghion](https://github.com/joeyAghion).
12
13
 
data/Gemfile CHANGED
@@ -2,11 +2,13 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- case version = ENV['MONGOID_VERSION'] || '6.0'
5
+ case version = ENV['MONGOID_VERSION'] || '8.0.2'
6
6
  when 'HEAD'
7
7
  gem 'mongoid', github: 'mongodb/mongoid'
8
+ when /^8/
9
+ gem 'mongoid', '~> 8.0'
8
10
  when /^7/
9
- gem 'mongoid', github: 'mongodb/mongoid', branch: '7.0-dev'
11
+ gem 'mongoid', '~> 7.0'
10
12
  when /^6/
11
13
  gem 'mongoid', '~> 6.0'
12
14
  when /^5/
@@ -24,7 +26,6 @@ end
24
26
 
25
27
  group :test do
26
28
  gem 'rspec'
27
- gem 'mongoid-danger', '~> 0.1.1', require: false
28
29
  end
29
30
 
30
31
  group :development do
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/README.md CHANGED
@@ -2,11 +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](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
+ Compatibility helpers for Mongoid versions 2, 3, 4, 5, 6, 7, and 8.
10
9
 
11
10
  ### Install
12
11
 
@@ -40,13 +39,16 @@ Mongoid::Compatibility::Version.mongoid6?
40
39
 
41
40
  Mongoid::Compatibility::Version.mongoid7?
42
41
  # => is this Mongoid 7.x?
42
+
43
+ Mongoid::Compatibility::Version.mongoid8?
44
+ # => is this Mongoid 8.x?
43
45
  ```
44
46
 
45
- Instead of checking for Mongoid 6 and 7, use `newer` and `older` helpers.
47
+ Instead of checking for Mongoid 6 and 7 and 8, use `newer` and `older` helpers.
46
48
 
47
49
  ``` ruby
48
50
  Mongoid::Compatibility::Version.mongoid6_or_newer?
49
- # => is this Mongoid 6.x or 7.x, including beta 7?
51
+ # => is this Mongoid 6.x or 7.x or 8.x, including beta 8?
50
52
 
51
53
  Mongoid::Compatibility::Version.mongoid5_or_older?
52
54
  # => is this Mongoid 2.x, 3.x, 4.x or 5.x?
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Compatibility
3
- VERSION = '0.5.1'.freeze
3
+ VERSION = '0.6.0'.freeze
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@ module Mongoid
2
2
  module Compatibility
3
3
  module Version
4
4
  module ClassMethods
5
- (2..7).each do |v|
5
+ (2..8).each do |v|
6
6
  const_set "V#{v}", Mongoid::VERSION =~ Regexp.new("^#{v}\.")
7
7
 
8
8
  define_method "mongoid#{v}?" do
@@ -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
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Mongoid::Compatibility::Version do
4
4
  context 'mongoid? methods' do
5
5
  it 'only true for one version' do
6
- expect((2..7).one? do |v|
6
+ expect((2..8).one? do |v|
7
7
  Mongoid::Compatibility::Version.send("mongoid#{v}?")
8
8
  end).to be true
9
9
  end
@@ -31,7 +31,7 @@ describe Mongoid::Compatibility::Version do
31
31
  expect(Mongoid::Compatibility::Version.send("mongoid#{version}_or_older?")).to be true
32
32
  end
33
33
  end
34
- (2..7).each do |v|
34
+ (2..8).each do |v|
35
35
  context "mongoid #{v}" do
36
36
  before do
37
37
  stub_const('::Mongoid::VERSION', "#{v}")
@@ -12,6 +12,8 @@ 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'
15
17
  else
16
18
  fail "unsupported Mongoid version #{Mongoid::VERSION}"
17
19
  end
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: 0.5.1
4
+ version: 0.6.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: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
@@ -38,12 +38,15 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description:
41
+ description:
42
42
  email: dblock@dblock.org
43
43
  executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
+ - ".github/workflows/danger.yml"
48
+ - ".github/workflows/rubocop.yml"
49
+ - ".github/workflows/test.yml"
47
50
  - ".gitignore"
48
51
  - ".rspec"
49
52
  - ".rubocop.yml"
@@ -53,6 +56,7 @@ files:
53
56
  - CONTRIBUTING.md
54
57
  - Dangerfile
55
58
  - Gemfile
59
+ - Gemfile.danger
56
60
  - LICENSE.md
57
61
  - README.md
58
62
  - RELEASING.md
@@ -70,6 +74,7 @@ files:
70
74
  - spec/config/mongoid5.yml
71
75
  - spec/config/mongoid6.yml
72
76
  - spec/config/mongoid7.yml
77
+ - spec/config/mongoid8.yml
73
78
  - spec/mongoid/compatibility/object_id_spec.rb
74
79
  - spec/mongoid/compatibility/self_spec.rb
75
80
  - spec/mongoid/compatibility/version_spec.rb
@@ -79,7 +84,7 @@ homepage: http://github.com/mongoid/mongoid-compatibility
79
84
  licenses:
80
85
  - MIT
81
86
  metadata: {}
82
- post_install_message:
87
+ post_install_message:
83
88
  rdoc_options: []
84
89
  require_paths:
85
90
  - lib
@@ -94,9 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
99
  - !ruby/object:Gem::Version
95
100
  version: 1.3.6
96
101
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.5.2
99
- signing_key:
102
+ rubygems_version: 3.1.3
103
+ signing_key:
100
104
  specification_version: 4
101
105
  summary: Compatibility helpers for Mongoid.
102
106
  test_files: []