mongoid-locker 0.3.5 → 0.3.6
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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +9 -7
- data/CHANGELOG.md +4 -0
- data/Gemfile +3 -1
- data/LICENSE.txt +1 -1
- data/README.md +9 -5
- data/RELEASING.md +68 -0
- data/lib/mongoid/locker/version.rb +1 -1
- data/lib/mongoid/locker/wrapper.rb +3 -1
- data/lib/mongoid/locker/wrapper7.rb +2 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf3cf7653f3a1d1719beb2b0a4e355f08ca0c377
|
4
|
+
data.tar.gz: ac2d977fd88b44794f8222b4897b8550de9881db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 476b1ff144e25f07ce7f8cd1829b42ff8ab2ad0cb3f2c66fef259a3c2a19b00cfc9cdc11aa5f7988ac3d39ae36b7e29d223ad70bf263e3705114965cd6179baa
|
7
|
+
data.tar.gz: 9849fccf0948617c075368cd7d6514eb91ca9ef677328859381ae606ff1f7b455251ec04f5bbc604e421405aaa1ba14fbcda1c83549f2bcdd977a6d23fb08b05
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -11,16 +11,18 @@ before_install:
|
|
11
11
|
|
12
12
|
matrix:
|
13
13
|
include:
|
14
|
-
- rvm: 2.3.
|
15
|
-
env: MONGOID_VERSION=2
|
16
|
-
- rvm: 2.3.1
|
17
|
-
env: MONGOID_VERSION=3
|
18
|
-
- rvm: 2.3.1
|
14
|
+
- rvm: 2.3.6
|
19
15
|
env: MONGOID_VERSION=4
|
20
|
-
- rvm: 2.3.
|
16
|
+
- rvm: 2.3.6
|
21
17
|
env: MONGOID_VERSION=5
|
22
|
-
- rvm: 2.3.
|
18
|
+
- rvm: 2.3.6
|
23
19
|
env: MONGOID_VERSION=6
|
20
|
+
- rvm: 2.4.3
|
21
|
+
env: MONGOID_VERSION=6
|
22
|
+
- rvm: 2.4.3
|
23
|
+
env: MONGOID_VERSION=7
|
24
|
+
- rvm: 2.5.0
|
25
|
+
env: MONGOID_VERSION=7
|
24
26
|
before_script:
|
25
27
|
- bundle exec danger
|
26
28
|
- rvm: rbx-2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### 0.3.6 (4/18/2018)
|
4
|
+
|
5
|
+
* [#52](https://github.com/mongoid/mongoid-locker/pull/52): Added support for Mongoid 7 - [@wuhuizuo](https://github.com/wuhuizuo).
|
6
|
+
|
3
7
|
### 0.3.5 (1/24/2017)
|
4
8
|
|
5
9
|
* [#43](https://github.com/mongoid/mongoid-locker/pull/43): Added support for Mongoid 6 - [@sivagollapalli](https://github.com/sivagollapalli).
|
data/Gemfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
case ENV['MONGOID_VERSION']
|
4
|
+
when /^7/
|
5
|
+
gem 'mongoid', '~> 7.0'
|
4
6
|
when /^6/
|
5
7
|
gem 'mongoid', '~> 6.0'
|
6
8
|
when /^5/
|
@@ -13,7 +15,7 @@ when /^2/
|
|
13
15
|
gem 'bson_ext', platforms: :ruby
|
14
16
|
gem 'mongoid', '~> 2.8'
|
15
17
|
else
|
16
|
-
gem 'mongoid', '>=
|
18
|
+
gem 'mongoid', '>= 4.0'
|
17
19
|
end
|
18
20
|
|
19
21
|
gemspec
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,11 @@
|
|
5
5
|
|
6
6
|
Document-level locking for MongoDB via Mongoid. The need arose at [Jux](https://jux.com) from multiple processes on multiple servers trying to act upon the same document and stepping on each other's toes. Mongoid-Locker is an easy way to ensure only one process can perform a certain operation on a document at a time.
|
7
7
|
|
8
|
-
[Tested](http://travis-ci.org/mongoid/mongoid-locker) against
|
8
|
+
[Tested](http://travis-ci.org/mongoid/mongoid-locker) against:
|
9
|
+
- MRI: `2.3.6`, `2.4.3`, `2.5.0`
|
10
|
+
- Mongoid: `2`, `3`, `4`, `5`, `6`, `7`
|
11
|
+
|
12
|
+
See [.travis.yml](.travis.yml) for the latest test matrix.
|
9
13
|
|
10
14
|
## Usage
|
11
15
|
|
@@ -38,7 +42,7 @@ queue_item.with_lock do
|
|
38
42
|
end
|
39
43
|
```
|
40
44
|
|
41
|
-
`#with_lock` takes an optional [handful of options around retrying](http://rdoc.info/github/mongoid/mongoid-locker/Mongoid/Locker:with_lock), so make sure to take a look.
|
45
|
+
The `#with_lock` function takes an optional [handful of options around retrying](http://rdoc.info/github/mongoid/mongoid-locker/Mongoid/Locker:with_lock), so make sure to take a look.
|
42
46
|
|
43
47
|
The default timeout can also be set on a per-class basis:
|
44
48
|
|
@@ -49,12 +53,12 @@ class QueueItem
|
|
49
53
|
end
|
50
54
|
```
|
51
55
|
|
52
|
-
Note that these locks are only enforced when using `#with_lock`, not at the database level.
|
56
|
+
Note that these locks are only enforced when using `#with_lock`, not at the database level. It's useful for transactional operations, where you can make atomic modification of the document with checks. For example, you could deduct a purchase from a user's balance ... _unless_ they are broke.
|
53
57
|
|
54
|
-
More in-depth method documentation can be found at [rdoc.info](http://rdoc.info/github/mongoid/mongoid-locker/frames).
|
58
|
+
More in-depth method documentation can be found at [rdoc.info](http://rdoc.info/github/mongoid/mongoid-locker/frames).
|
55
59
|
|
56
60
|
## Copyright & License
|
57
61
|
|
58
|
-
Copyright (c) 2012-
|
62
|
+
Copyright (c) 2012-2018 Aidan Feldman & Contributors
|
59
63
|
|
60
64
|
MIT License, see [LICENSE](LICENSE.txt) for more information.
|
data/RELEASING.md
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
Releasing Mongoid::Locker
|
2
|
+
=========================
|
3
|
+
|
4
|
+
There're no particular rules about when to release mongoid-locker. Release bug fixes frequently, features not so frequently and breaking API changes rarely.
|
5
|
+
|
6
|
+
### Release
|
7
|
+
|
8
|
+
Run tests, check that all tests succeed locally.
|
9
|
+
|
10
|
+
```
|
11
|
+
bundle install
|
12
|
+
rake
|
13
|
+
```
|
14
|
+
|
15
|
+
Check that the last build succeeded in [Travis CI](https://travis-ci.org/mongoid/mongoid-locker) for all supported platforms.
|
16
|
+
|
17
|
+
Check the version, if needed modify [lib/mongoid/locker/version.rb](lib/mongoid/locker/version.rb).
|
18
|
+
|
19
|
+
* Increment the third number if the release has bug fixes and/or very minor features, only (eg. change `0.5.1` to `0.5.2`).
|
20
|
+
* Increment the second number if the release contains major features or breaking API changes (eg. change `0.5.1` to `0.4.0`).
|
21
|
+
|
22
|
+
Change "Next Release" in [CHANGELOG.md](CHANGELOG.md) to the new version.
|
23
|
+
|
24
|
+
```
|
25
|
+
### 0.4.0 (2014-01-27)
|
26
|
+
```
|
27
|
+
|
28
|
+
Remove the line with "Your contribution here.", since there will be no more contributions to this release.
|
29
|
+
|
30
|
+
Commit your changes.
|
31
|
+
|
32
|
+
```
|
33
|
+
git add CHANGELOG.md lib/mongoid-locker/version.rb
|
34
|
+
git commit -m "Preparing for release, 0.4.0."
|
35
|
+
git push origin master
|
36
|
+
```
|
37
|
+
|
38
|
+
Release.
|
39
|
+
|
40
|
+
```
|
41
|
+
$ rake release
|
42
|
+
|
43
|
+
mongoid-locker 0.4.0 built to pkg/mongoid-locker-0.4.0.gem.
|
44
|
+
Tagged v0.4.0.
|
45
|
+
Pushed git commits and tags.
|
46
|
+
Pushed mongoid-locker 0.4.0 to rubygems.org.
|
47
|
+
```
|
48
|
+
|
49
|
+
### Prepare for the Next Version
|
50
|
+
|
51
|
+
Add the next release to [CHANGELOG.md](CHANGELOG.md).
|
52
|
+
|
53
|
+
```
|
54
|
+
Next Release
|
55
|
+
============
|
56
|
+
|
57
|
+
* Your contribution here.
|
58
|
+
```
|
59
|
+
|
60
|
+
Increment the minor version, modify [lib/mongoid-locker/version.rb](lib/mongoid-locker/version.rb).
|
61
|
+
|
62
|
+
Commit your changes.
|
63
|
+
|
64
|
+
```
|
65
|
+
git add CHANGELOG.md lib/mongoid-locker/version.rb
|
66
|
+
git commit -m "Preparing for next release, 0.4.1."
|
67
|
+
git push origin master
|
68
|
+
```
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'mongoid/compatibility'
|
2
2
|
|
3
|
-
if Mongoid::Compatibility::Version.
|
3
|
+
if Mongoid::Compatibility::Version.mongoid7?
|
4
|
+
require 'mongoid/locker/wrapper7'
|
5
|
+
elsif Mongoid::Compatibility::Version.mongoid6?
|
4
6
|
require 'mongoid/locker/wrapper6'
|
5
7
|
elsif Mongoid::Compatibility::Version.mongoid5?
|
6
8
|
require 'mongoid/locker/wrapper5'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-locker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aidan Feldman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- Guardfile
|
60
60
|
- LICENSE.txt
|
61
61
|
- README.md
|
62
|
+
- RELEASING.md
|
62
63
|
- Rakefile
|
63
64
|
- demo/README.md
|
64
65
|
- demo/config/mongoid.yml
|
@@ -75,6 +76,7 @@ files:
|
|
75
76
|
- lib/mongoid/locker/wrapper4.rb
|
76
77
|
- lib/mongoid/locker/wrapper5.rb
|
77
78
|
- lib/mongoid/locker/wrapper6.rb
|
79
|
+
- lib/mongoid/locker/wrapper7.rb
|
78
80
|
- mongoid-locker.gemspec
|
79
81
|
homepage: https://github.com/mongoid/mongoid-locker
|
80
82
|
licenses:
|
@@ -96,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
98
|
version: '0'
|
97
99
|
requirements: []
|
98
100
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.6.12
|
100
102
|
signing_key:
|
101
103
|
specification_version: 4
|
102
104
|
summary: Document-level locking for MongoDB via Mongoid.
|