mongoid-tag-collectible 0.2.1 → 0.2.3
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 +5 -5
- data/.github/workflows/test.yml +52 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +12 -3
- data/CONTRIBUTING.md +4 -4
- data/Gemfile +11 -12
- data/README.md +5 -4
- data/RELEASING.md +50 -0
- data/examples/readme.rb +1 -1
- data/lib/mongoid-tag-collectible/tag.rb +1 -1
- data/lib/mongoid-tag-collectible/tagged.rb +10 -5
- data/lib/mongoid-tag-collectible/version.rb +1 -1
- data/lib/mongoid-tag-collectible.rb +1 -1
- data/mongoid-tag-collectible.gemspec +2 -1
- data/spec/config/mongoid3.yml +3 -2
- data/spec/config/mongoid4.yml +1 -1
- data/spec/config/mongoid5.yml +1 -1
- data/spec/mongoid-tag-collectible/tag_spec.rb +1 -1
- data/spec/spec_helper.rb +15 -1
- data/spec/support/mongoid.rb +5 -5
- metadata +24 -11
- data/.travis.yml +0 -16
- data/lib/mongoid-tag-collectible/mongoid.rb +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 40d24d73bd488bdf32419bf9e8e5b4db03efa3614bf04bc03215de066eba05d0
|
|
4
|
+
data.tar.gz: 8017e4de8d5f5d9f0438570347d36bd322cbeb799ddf0d19a11641fbc752d5af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d6939065fc8e5e8d91586f80a526929838bc7437c888bcdf9a61df276a04c14e2df959d4936ee64cf4665bb1c37ccc135ce914318381e003bf4191fc7b7dfb0
|
|
7
|
+
data.tar.gz: '0966053468f643eb53255e804231884494e1e2611b1ecfab0af91f0a49ad31ab57c8231f99bc6569ad27f6eb483db88605cc67e6115301f993d600fcecdf20e7'
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
name: Ruby ${{ matrix.ruby }} / Mongoid ${{ matrix.mongoid }} / MongoDB ${{ matrix.mongodb }}
|
|
11
|
+
runs-on: ubuntu-22.04
|
|
12
|
+
timeout-minutes: 15
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
include:
|
|
17
|
+
- { ruby: '2.3.8', mongoid: '3', mongodb: '2.6', bundler: '2.3.26' }
|
|
18
|
+
- { ruby: '2.3.8', mongoid: '4', mongodb: '2.6', bundler: '2.3.26' }
|
|
19
|
+
- { ruby: '2.3.8', mongoid: '5', mongodb: '4.0', bundler: '2.3.26' }
|
|
20
|
+
- { ruby: '2.5.9', mongoid: '6', mongodb: '4.0', bundler: '2.3.26' }
|
|
21
|
+
- { ruby: '2.7.8', mongoid: '7', mongodb: '4.4', bundler: '2.4.22' }
|
|
22
|
+
- { ruby: '3.2', mongoid: '8', mongodb: '6.0', bundler: default }
|
|
23
|
+
- { ruby: '3.3', mongoid: '9', mongodb: '7.0', bundler: default }
|
|
24
|
+
- { ruby: '3.4', mongoid: '9', mongodb: '8.0', bundler: default }
|
|
25
|
+
- { ruby: '4.0', mongoid: '9', mongodb: '8.0', bundler: default }
|
|
26
|
+
env:
|
|
27
|
+
MONGOID_VERSION: ${{ matrix.mongoid }}
|
|
28
|
+
COVERAGE: ${{ matrix.ruby == '4.0' && 'true' || 'false' }}
|
|
29
|
+
services:
|
|
30
|
+
mongodb:
|
|
31
|
+
image: mongo:${{ matrix.mongodb }}
|
|
32
|
+
ports: ['27017:27017']
|
|
33
|
+
options: >-
|
|
34
|
+
--health-cmd "bash -c 'echo > /dev/tcp/127.0.0.1/27017'"
|
|
35
|
+
--health-interval 5s --health-timeout 5s --health-retries 20
|
|
36
|
+
steps:
|
|
37
|
+
- uses: actions/checkout@v6
|
|
38
|
+
- uses: ruby/setup-ruby@v1
|
|
39
|
+
with:
|
|
40
|
+
ruby-version: ${{ matrix.ruby }}
|
|
41
|
+
bundler: ${{ matrix.bundler }}
|
|
42
|
+
bundler-cache: true
|
|
43
|
+
- run: bundle exec rake spec
|
|
44
|
+
- name: Report coverage to Coveralls
|
|
45
|
+
if: matrix.ruby == '4.0'
|
|
46
|
+
uses: coverallsapp/github-action@v2
|
|
47
|
+
with:
|
|
48
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
49
|
+
file: coverage/.resultset.json
|
|
50
|
+
format: simplecov
|
|
51
|
+
- if: matrix.mongoid == '5'
|
|
52
|
+
run: bundle exec rake rubocop
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
### 0.2.
|
|
1
|
+
### 0.2.3 (2026/10/14)
|
|
2
|
+
|
|
3
|
+
* [#3](https://github.com/mongoid/mongoid-tag-collectible/pull/3): Replace obsolete quality and dependency badges with Coveralls, generate real SimpleCov coverage in one modern CI job, and scope badges to upstream master.
|
|
4
|
+
* [#3](https://github.com/mongoid/mongoid-tag-collectible/pull/3): Modernize CI with GitHub Actions through Ruby 4.0, Mongoid 9, and MongoDB Server 8.0, retaining legacy Mongoid coverage and accounting for modern after-save dirty tracking when updating tag counts.
|
|
5
|
+
|
|
6
|
+
### 0.2.2 (2015/09/17)
|
|
7
|
+
|
|
8
|
+
* Officially compatible with Mongoid 5 - [@dblock](https://github.com/dblock).
|
|
9
|
+
|
|
10
|
+
### 0.2.1 (2015/08/12)
|
|
2
11
|
|
|
3
12
|
* Fix: support for namespaced classes with name repeated in module name - [@dblock](https://github.com/dblock).
|
|
4
13
|
|
|
5
|
-
### 0.2.0 (08/12
|
|
14
|
+
### 0.2.0 (2015/08/12)
|
|
6
15
|
|
|
7
16
|
* Implemented RuboCop, Ruby-style linter - [@dblock](https://github.com/dblock).
|
|
8
17
|
* Added support for Mongoid 4 and Mongoid 5 Beta - [@dblock](https://github.com/dblock).
|
|
9
18
|
* Added support for namespaced classes - [@dblock](https://github.com/dblock).
|
|
10
19
|
|
|
11
|
-
### 0.1.0 (06/26
|
|
20
|
+
### 0.1.0 (2013/06/26)
|
|
12
21
|
|
|
13
22
|
* Initial public release, written on a plane from SF to NYC - [@dblock](https://github.com/dblock).
|
data/CONTRIBUTING.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Contributing to Mongoid-Tag-Collectible
|
|
2
2
|
=======================================
|
|
3
3
|
|
|
4
|
-
Mongoid-Tag-Collectible is work of [many of contributors](https://github.com/
|
|
4
|
+
Mongoid-Tag-Collectible is work of [many of contributors](https://github.com/mongoid/mongoid-tag-collectible/graphs/contributors). You're encouraged to submit [pull requests](https://github.com/mongoid/mongoid-tag-collectible/pulls), [propose features, ask questions and discuss issues](https://github.com/mongoid/mongoid-tag-collectible/issues).
|
|
5
5
|
|
|
6
6
|
#### Fork the Project
|
|
7
7
|
|
|
8
|
-
Fork the [project on Github](https://github.com/
|
|
8
|
+
Fork the [project on Github](https://github.com/mongoid/mongoid-tag-collectible) and check out your copy.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
11
|
git clone https://github.com/contributor/mongoid-tag-collectible.git
|
|
12
12
|
cd mongoid-tag-collectible
|
|
13
|
-
git remote add upstream https://github.com/
|
|
13
|
+
git remote add upstream https://github.com/mongoid/mongoid-tag-collectible.git
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
#### Create a Topic Branch
|
|
@@ -95,7 +95,7 @@ git push origin my-feature-branch -f
|
|
|
95
95
|
Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
|
|
96
96
|
|
|
97
97
|
```
|
|
98
|
-
* [#123](https://github.com/
|
|
98
|
+
* [#123](https://github.com/mongoid/mongoid-tag-collectible/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
Amend your previous commit and force push the changes.
|
data/Gemfile
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
source '
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
gem 'mongoid', '~> 3.1'
|
|
10
|
-
else
|
|
11
|
-
gem 'mongoid', version
|
|
12
|
-
end
|
|
5
|
+
version = ENV['MONGOID_VERSION'] || '9'
|
|
6
|
+
gem 'mongoid', version =~ /\A\d+\z/ ? "~> #{version}.0" : version
|
|
7
|
+
gem 'bigdecimal' if RUBY_VERSION >= '3.4'
|
|
8
|
+
gem 'logger' if RUBY_VERSION >= '3.4'
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
gem '
|
|
16
|
-
gem '
|
|
10
|
+
group :development, :test do
|
|
11
|
+
gem 'rspec'
|
|
12
|
+
gem 'rake', RUBY_VERSION >= '3.0' ? '>= 12' : '< 12'
|
|
13
|
+
gem 'rubocop', RUBY_VERSION >= '3.0' ? '~> 1.0' : '0.32.1'
|
|
14
|
+
gem 'simplecov', '~> 0.22' if ENV['COVERAGE'] == 'true'
|
|
15
|
+
end
|
data/README.md
CHANGED
|
@@ -2,15 +2,16 @@ Mongoid::TagCollectible
|
|
|
2
2
|
=======================
|
|
3
3
|
|
|
4
4
|
[](http://badge.fury.io/rb/mongoid-tag-collectible)
|
|
5
|
-
[](https://github.com/mongoid/mongoid-tag-collectible/actions/workflows/test.yml?query=branch%3Amaster)
|
|
6
|
+
[](https://coveralls.io/github/mongoid/mongoid-tag-collectible?branch=master)
|
|
7
|
+
|
|
8
|
+
The Ruby 4.0 CI job measures library line coverage with SimpleCov and submits `coverage/.resultset.json` to Coveralls using GitHub's automatic token. Other matrix jobs do not submit duplicate reports. Run `COVERAGE=true bundle install` followed by `COVERAGE=true bundle exec rake spec` for a local report. The default-branch badge requires Coveralls to accept an upstream `master` build; configuring this workflow does not activate the external service.
|
|
8
9
|
|
|
9
10
|
Easily maintain a collection of `Tag` instances with aggregate counts from your model's `tags`.
|
|
10
11
|
|
|
11
12
|
### Compatibility
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
CI tests representative compatible combinations of Mongoid 3 through 9, Ruby 2.3 through 4.0, and MongoDB Server 2.6 through 8.0, including Ruby 4.0 / Mongoid 9 / MongoDB 8.0. See [the test matrix](.github/workflows/test.yml); this is not a Cartesian product of supported versions. Mongoid 3–4 use MongoDB 2.6 because their Moped driver enumerates collections via the removed `system.namespaces` collection. Set `MONGOID_VERSION` to select a Mongoid major version and `MONGODB_HOST` to override the default `localhost:27017` when running tests.
|
|
14
15
|
|
|
15
16
|
### Install
|
|
16
17
|
|
data/RELEASING.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Releasing Mongoid Tag Collectible
|
|
2
|
+
|
|
3
|
+
## Prepare
|
|
4
|
+
|
|
5
|
+
Use the upstream checkout on a clean `master`, verify `origin` points to `mongoid/mongoid-tag-collectible`, and run `git pull --ff-only`. Check supported combinations in [GitHub Actions](https://github.com/mongoid/mongoid-tag-collectible/actions). Use patch versions for fixes, minor versions for backward-compatible features, and major versions for breaking changes.
|
|
6
|
+
|
|
7
|
+
Update `lib/mongoid-tag-collectible/version.rb`. Date the matching changelog section using `YYYY/MM/DD` and remove its contribution placeholder.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bundle install
|
|
11
|
+
bundle exec rake
|
|
12
|
+
git add CHANGELOG.md lib/mongoid-tag-collectible/version.rb RELEASING.md
|
|
13
|
+
git commit -m "Preparing for release, 0.2.3."
|
|
14
|
+
git push origin master
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Wait for the preparation commit's CI checks to pass.
|
|
18
|
+
|
|
19
|
+
## Publish RubyGems and GitHub
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
bundle exec rake release
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The task builds the package, pushes its tag, and publishes to RubyGems. Complete MFA when prompted. If interrupted, inspect the existing tag and RubyGems version before retrying; never move a published tag. If only publication is missing, resume with `gem push pkg/mongoid-tag-collectible-0.2.3.gem`.
|
|
26
|
+
|
|
27
|
+
A Git tag is not a GitHub release. Once RubyGems publication is verified, publish a matching GitHub release with changelog notes:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
version=0.2.3
|
|
31
|
+
notes="$(mktemp)"
|
|
32
|
+
awk -v version="$version" '
|
|
33
|
+
/^### / {
|
|
34
|
+
if (found) exit
|
|
35
|
+
if ($2 == version) found = 1
|
|
36
|
+
next
|
|
37
|
+
}
|
|
38
|
+
found { print }
|
|
39
|
+
' CHANGELOG.md > "$notes"
|
|
40
|
+
gh release create "v$version" --repo mongoid/mongoid-tag-collectible --verify-tag --title "$version" --notes-file "$notes" --latest
|
|
41
|
+
rm "$notes"
|
|
42
|
+
curl --fail --silent --show-error "https://rubygems.org/api/v2/rubygems/mongoid-tag-collectible/versions/$version.json"
|
|
43
|
+
gh release view "v$version" --repo mongoid/mongoid-tag-collectible
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Verify both the published gem and non-draft GitHub release before declaring completion.
|
|
47
|
+
|
|
48
|
+
## Prepare the Next Version
|
|
49
|
+
|
|
50
|
+
Increment the development patch version in `lib/mongoid-tag-collectible/version.rb` (for example, `0.2.4`). Add `### 0.2.4 (Next)` with a contribution placeholder above the released changelog section. Commit and push to `master`, leaving the released tag unchanged.
|
data/examples/readme.rb
CHANGED
|
@@ -36,7 +36,7 @@ p Thing.first.tags # [ 'red', 'sad' ]
|
|
|
36
36
|
ThingTag.find('red').destroy
|
|
37
37
|
p Thing.first.tags # [ 'sad' ]
|
|
38
38
|
|
|
39
|
-
if Mongoid::
|
|
39
|
+
if Mongoid::Compatibility::Version.mongoid3? || Mongoid::Compatibility::Version.mongoid4?
|
|
40
40
|
Mongoid.default_session.drop
|
|
41
41
|
else
|
|
42
42
|
Mongoid::Clients.default.database.drop
|
|
@@ -25,7 +25,7 @@ module Mongoid
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
module ClassMethods
|
|
28
|
-
if Mongoid::
|
|
28
|
+
if Mongoid::Compatibility::Version.mongoid3? || Mongoid::Compatibility::Version.mongoid4?
|
|
29
29
|
def rename_tag!(old_tag, new_tag)
|
|
30
30
|
collection.where(tags: old_tag).update({ '$addToSet' => { tags: new_tag } }, multi: true)
|
|
31
31
|
self.remove_tag!(old_tag)
|
|
@@ -48,10 +48,15 @@ module Mongoid
|
|
|
48
48
|
|
|
49
49
|
private
|
|
50
50
|
|
|
51
|
+
def _saved_tag_changes
|
|
52
|
+
tag_changes = Mongoid::VERSION.to_i >= 8 ? previous_changes['tags'] : changes['tags']
|
|
53
|
+
tag_changes && tag_changes.map { |tags| tags || [] }
|
|
54
|
+
end
|
|
55
|
+
|
|
51
56
|
def _update_tags!
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
after =
|
|
57
|
+
tag_changes = _saved_tag_changes
|
|
58
|
+
return unless tag_changes
|
|
59
|
+
before, after = tag_changes
|
|
55
60
|
# added tags
|
|
56
61
|
(after - before).each do |tag|
|
|
57
62
|
next unless tag && tag.length > 0
|
|
@@ -64,7 +69,7 @@ module Mongoid
|
|
|
64
69
|
end
|
|
65
70
|
end
|
|
66
71
|
|
|
67
|
-
if Mongoid::
|
|
72
|
+
if Mongoid::Compatibility::Version.mongoid3? || Mongoid::Compatibility::Version.mongoid4?
|
|
68
73
|
def _update_tag!(tag, count)
|
|
69
74
|
tag_class.collection.find(
|
|
70
75
|
name: tag,
|
|
@@ -10,9 +10,10 @@ Gem::Specification.new do |s|
|
|
|
10
10
|
s.required_rubygems_version = '>= 1.3.6'
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
|
12
12
|
s.require_paths = ['lib']
|
|
13
|
-
s.homepage = 'http://github.com/
|
|
13
|
+
s.homepage = 'http://github.com/mongoid/mongoid-tag-collectible'
|
|
14
14
|
s.licenses = ['MIT']
|
|
15
15
|
s.summary = "Easily maintain a collection of Tag instances with aggregate counts from your model's tags."
|
|
16
16
|
s.add_dependency 'mongoid', '>= 3.0.0'
|
|
17
|
+
s.add_dependency 'mongoid-compatibility'
|
|
17
18
|
s.add_dependency 'activesupport'
|
|
18
19
|
end
|
data/spec/config/mongoid3.yml
CHANGED
data/spec/config/mongoid4.yml
CHANGED
data/spec/config/mongoid5.yml
CHANGED
|
@@ -48,7 +48,7 @@ describe Mongoid::TagCollectible::Tag do
|
|
|
48
48
|
end
|
|
49
49
|
it 'prevents duplicates' do
|
|
50
50
|
TestTaggedTag.create!(name: 'one')
|
|
51
|
-
if Mongoid::
|
|
51
|
+
if Mongoid::Compatibility::Version.mongoid3? || Mongoid::Compatibility::Version.mongoid4?
|
|
52
52
|
expect { TestTaggedTag.create!(name: 'one') }.to raise_error Moped::Errors::OperationFailure, /duplicate key error/
|
|
53
53
|
else
|
|
54
54
|
expect { TestTaggedTag.create!(name: 'one') }.to raise_error Mongo::Error::OperationFailure, /duplicate key error/
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
if ENV['COVERAGE'] == 'true'
|
|
2
|
+
require 'simplecov'
|
|
3
|
+
SimpleCov.start do
|
|
4
|
+
track_files 'lib/**/*.rb'
|
|
5
|
+
add_filter '/spec/'
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
|
|
1
9
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
10
|
|
|
3
11
|
require 'rubygems'
|
|
@@ -8,4 +16,10 @@ require 'support/mongoid'
|
|
|
8
16
|
require 'support/test_tagged'
|
|
9
17
|
require 'support/namespaced_test_tagged'
|
|
10
18
|
|
|
11
|
-
RSpec.configure
|
|
19
|
+
RSpec.configure do |config|
|
|
20
|
+
config.raise_errors_for_deprecations!
|
|
21
|
+
config.before :all do
|
|
22
|
+
Mongoid.logger.level = Logger::INFO
|
|
23
|
+
Mongo::Logger.logger.level = Logger::INFO if Mongoid::Compatibility::Version.mongoid5?
|
|
24
|
+
end
|
|
25
|
+
end
|
data/spec/support/mongoid.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ENV['MONGOID_ENV'] = 'test'
|
|
2
2
|
|
|
3
|
-
if Mongoid::
|
|
3
|
+
if Mongoid::Compatibility::Version.mongoid3?
|
|
4
4
|
Mongoid.load! 'spec/config/mongoid3.yml'
|
|
5
|
-
elsif Mongoid::
|
|
5
|
+
elsif Mongoid::Compatibility::Version.mongoid4?
|
|
6
6
|
Mongoid.load! 'spec/config/mongoid4.yml'
|
|
7
7
|
else
|
|
8
8
|
Mongoid.load! 'spec/config/mongoid5.yml'
|
|
@@ -12,7 +12,7 @@ RSpec.configure do |config|
|
|
|
12
12
|
config.before(:all) do
|
|
13
13
|
@indexes = []
|
|
14
14
|
klass = TestTagged.tag_class
|
|
15
|
-
if Mongoid::
|
|
15
|
+
if Mongoid::Compatibility::Version.mongoid3?
|
|
16
16
|
TestTagged.tag_class.index_options.each_pair do |name, options|
|
|
17
17
|
@indexes << [klass, name, options]
|
|
18
18
|
end
|
|
@@ -25,7 +25,7 @@ RSpec.configure do |config|
|
|
|
25
25
|
config.before do
|
|
26
26
|
Mongoid.purge!
|
|
27
27
|
@indexes.each do |klass, name, options|
|
|
28
|
-
if Mongoid::
|
|
28
|
+
if Mongoid::Compatibility::Version.mongoid3? || Mongoid::Compatibility::Version.mongoid4?
|
|
29
29
|
klass.collection.indexes.create(name, options)
|
|
30
30
|
else
|
|
31
31
|
klass.collection.indexes.create_one(name, options)
|
|
@@ -33,7 +33,7 @@ RSpec.configure do |config|
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
config.after(:all) do
|
|
36
|
-
if Mongoid::
|
|
36
|
+
if Mongoid::Compatibility::Version.mongoid3? || Mongoid::Compatibility::Version.mongoid4?
|
|
37
37
|
Mongoid.default_session.drop
|
|
38
38
|
else
|
|
39
39
|
Mongoid::Clients.default.database.drop
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mongoid-tag-collectible
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
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:
|
|
11
|
+
date: 2026-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mongoid
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 3.0.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: mongoid-compatibility
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: activesupport
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -38,26 +52,26 @@ dependencies:
|
|
|
38
52
|
- - ">="
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
54
|
version: '0'
|
|
41
|
-
description:
|
|
55
|
+
description:
|
|
42
56
|
email: dblock@dblock.org
|
|
43
57
|
executables: []
|
|
44
58
|
extensions: []
|
|
45
59
|
extra_rdoc_files: []
|
|
46
60
|
files:
|
|
61
|
+
- ".github/workflows/test.yml"
|
|
47
62
|
- ".gitignore"
|
|
48
63
|
- ".rspec"
|
|
49
64
|
- ".rubocop.yml"
|
|
50
65
|
- ".rubocop_todo.yml"
|
|
51
|
-
- ".travis.yml"
|
|
52
66
|
- CHANGELOG.md
|
|
53
67
|
- CONTRIBUTING.md
|
|
54
68
|
- Gemfile
|
|
55
69
|
- LICENSE.md
|
|
56
70
|
- README.md
|
|
71
|
+
- RELEASING.md
|
|
57
72
|
- Rakefile
|
|
58
73
|
- examples/readme.rb
|
|
59
74
|
- lib/mongoid-tag-collectible.rb
|
|
60
|
-
- lib/mongoid-tag-collectible/mongoid.rb
|
|
61
75
|
- lib/mongoid-tag-collectible/tag.rb
|
|
62
76
|
- lib/mongoid-tag-collectible/tagged.rb
|
|
63
77
|
- lib/mongoid-tag-collectible/version.rb
|
|
@@ -74,11 +88,11 @@ files:
|
|
|
74
88
|
- spec/support/mongoid.rb
|
|
75
89
|
- spec/support/namespaced_test_tagged.rb
|
|
76
90
|
- spec/support/test_tagged.rb
|
|
77
|
-
homepage: http://github.com/
|
|
91
|
+
homepage: http://github.com/mongoid/mongoid-tag-collectible
|
|
78
92
|
licenses:
|
|
79
93
|
- MIT
|
|
80
94
|
metadata: {}
|
|
81
|
-
post_install_message:
|
|
95
|
+
post_install_message:
|
|
82
96
|
rdoc_options: []
|
|
83
97
|
require_paths:
|
|
84
98
|
- lib
|
|
@@ -93,9 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
93
107
|
- !ruby/object:Gem::Version
|
|
94
108
|
version: 1.3.6
|
|
95
109
|
requirements: []
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
signing_key:
|
|
110
|
+
rubygems_version: 3.5.16
|
|
111
|
+
signing_key:
|
|
99
112
|
specification_version: 4
|
|
100
113
|
summary: Easily maintain a collection of Tag instances with aggregate counts from
|
|
101
114
|
your model's tags.
|
data/.travis.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module Mongoid
|
|
2
|
-
module TagCollectible
|
|
3
|
-
def self.mongoid3?
|
|
4
|
-
Mongoid::VERSION =~ /^3\./
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
def self.mongoid4?
|
|
8
|
-
Mongoid::VERSION =~ /^4\./
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def self.object_id?(value)
|
|
12
|
-
self.mongoid3? ? Moped::BSON::ObjectId.legal?(value) : BSON::ObjectId.legal?(value)
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|