database_cleaner-nobrainer 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +41 -44
- data/README.md +11 -1
- data/database_cleaner-nobrainer.gemspec +2 -2
- data/lib/database_cleaner/nobrainer/deletion.rb +7 -4
- data/lib/database_cleaner/nobrainer/version.rb +1 -1
- data/lib/database_cleaner-nobrainer.rb +8 -0
- metadata +11 -13
- data/gemfiles/.bundle/config +0 -2
- data/gemfiles/nobrainer0.gemfile +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a661979e7c9de6be0404809646eeb7fbc0d49ff6dfac05def272dc6fef434919
|
4
|
+
data.tar.gz: a0768b2e7ec81e73cc543662a09ac5c30ed6b18da0561550d58f2b5d3b8fad02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9162b07fd616b4207062d32da4e5d5a71d310898d88fccecae4e90b6acb1f620b5cea2fd8832ea717f3f89127c0828b059184d6bc14bd1351215dbd5bb87dc01
|
7
|
+
data.tar.gz: af999242a966a36cf015eaf9003fc1a63b894495dc1842c6ed24061082d55d0761dea185b56dc8a21e03b1383297f26a561e41063d9bb57d0d9fc99eef557554
|
data/Gemfile.lock
CHANGED
@@ -1,81 +1,78 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/DatabaseCleaner/database_cleaner
|
3
|
-
revision:
|
3
|
+
revision: 068656a246fcb56ab1385e7370b2740f5ebef5db
|
4
4
|
specs:
|
5
|
-
database_cleaner-core (2.0.
|
5
|
+
database_cleaner-core (2.0.1)
|
6
6
|
|
7
7
|
PATH
|
8
8
|
remote: .
|
9
9
|
specs:
|
10
|
-
database_cleaner-nobrainer (1.
|
10
|
+
database_cleaner-nobrainer (1.1.0)
|
11
11
|
database_cleaner-core (~> 2.0.0.beta2)
|
12
|
-
nobrainer
|
12
|
+
nobrainer
|
13
13
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
activemodel (
|
18
|
-
activesupport (=
|
19
|
-
activesupport (
|
17
|
+
activemodel (7.0.4.2)
|
18
|
+
activesupport (= 7.0.4.2)
|
19
|
+
activesupport (7.0.4.2)
|
20
20
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
21
|
-
i18n (>=
|
22
|
-
minitest (
|
23
|
-
tzinfo (~>
|
24
|
-
|
25
|
-
appraisal (2.3.0)
|
21
|
+
i18n (>= 1.6, < 2)
|
22
|
+
minitest (>= 5.1)
|
23
|
+
tzinfo (~> 2.0)
|
24
|
+
appraisal (2.4.1)
|
26
25
|
bundler
|
27
26
|
rake
|
28
27
|
thor (>= 0.14.0)
|
29
28
|
byebug (11.1.3)
|
30
|
-
codecov (0.
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
i18n (1.8.5)
|
29
|
+
codecov (0.6.0)
|
30
|
+
simplecov (>= 0.15, < 0.22)
|
31
|
+
concurrent-ruby (1.2.0)
|
32
|
+
diff-lcs (1.5.0)
|
33
|
+
docile (1.4.0)
|
34
|
+
i18n (1.12.0)
|
37
35
|
concurrent-ruby (~> 1.0)
|
38
|
-
json (2.3.1)
|
39
36
|
middleware (0.1.0)
|
40
|
-
minitest (5.
|
41
|
-
nobrainer (0.
|
42
|
-
activemodel (>= 4.1.0)
|
43
|
-
activesupport (>= 4.1.0)
|
37
|
+
minitest (5.17.0)
|
38
|
+
nobrainer (0.43.0)
|
39
|
+
activemodel (>= 4.1.0, < 8)
|
40
|
+
activesupport (>= 4.1.0, < 8)
|
44
41
|
middleware (~> 0.1.0)
|
45
|
-
rethinkdb (>= 2.3.0)
|
42
|
+
rethinkdb (>= 2.3.0, < 2.5)
|
46
43
|
symbol_decoration (~> 1.1)
|
47
|
-
rake (13.0.
|
44
|
+
rake (13.0.6)
|
48
45
|
rethinkdb (2.4.0.0)
|
49
|
-
rspec (3.
|
50
|
-
rspec-core (~> 3.
|
51
|
-
rspec-expectations (~> 3.
|
52
|
-
rspec-mocks (~> 3.
|
53
|
-
rspec-core (3.
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-expectations (3.
|
46
|
+
rspec (3.12.0)
|
47
|
+
rspec-core (~> 3.12.0)
|
48
|
+
rspec-expectations (~> 3.12.0)
|
49
|
+
rspec-mocks (~> 3.12.0)
|
50
|
+
rspec-core (3.12.1)
|
51
|
+
rspec-support (~> 3.12.0)
|
52
|
+
rspec-expectations (3.12.2)
|
56
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
-
rspec-support (~> 3.
|
58
|
-
rspec-mocks (3.
|
54
|
+
rspec-support (~> 3.12.0)
|
55
|
+
rspec-mocks (3.12.3)
|
59
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-support (3.
|
62
|
-
simplecov (0.
|
57
|
+
rspec-support (~> 3.12.0)
|
58
|
+
rspec-support (3.12.0)
|
59
|
+
simplecov (0.21.2)
|
63
60
|
docile (~> 1.1)
|
64
61
|
simplecov-html (~> 0.11)
|
62
|
+
simplecov_json_formatter (~> 0.1)
|
65
63
|
simplecov-html (0.12.3)
|
64
|
+
simplecov_json_formatter (0.1.4)
|
66
65
|
symbol_decoration (1.1.0)
|
67
|
-
thor (1.
|
68
|
-
|
69
|
-
|
70
|
-
thread_safe (~> 0.1)
|
71
|
-
zeitwerk (2.4.0)
|
66
|
+
thor (1.2.1)
|
67
|
+
tzinfo (2.0.6)
|
68
|
+
concurrent-ruby (~> 1.0)
|
72
69
|
|
73
70
|
PLATFORMS
|
74
71
|
ruby
|
75
72
|
|
76
73
|
DEPENDENCIES
|
77
74
|
appraisal (~> 2)
|
78
|
-
bundler
|
75
|
+
bundler
|
79
76
|
byebug
|
80
77
|
codecov
|
81
78
|
database_cleaner-core!
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Database Cleaner Adapter for Nobrainer
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![.github/workflows/ci.yml](https://github.com/zedtux/database_cleaner-nobrainer/actions/workflows/ci.yml/badge.svg)](https://github.com/zedtux/database_cleaner-nobrainer/actions/workflows/ci.yml)
|
4
4
|
|
5
5
|
Clean your Nobrainer databases with Database Cleaner.
|
6
6
|
|
@@ -48,6 +48,16 @@ DatabaseCleaner[:nobrainer, connection: :shard_1]
|
|
48
48
|
DatabaseCleaner[:nobrainer, connection: :shard_2]
|
49
49
|
```
|
50
50
|
|
51
|
+
## Earthfile
|
52
|
+
|
53
|
+
The `Earthfile` is to be used with [Earthly](https://www.earthly.dev).
|
54
|
+
|
55
|
+
To build the development Docker image, simply run `earth +dev`.
|
56
|
+
To run the tests, run `earth -P +rspec`
|
57
|
+
To publish a new version of the gem, run `earthly +publish --RUBYGEMS_OTP=<OTP> --RUBYGEMS_ORG_API_KEY=$(cat ~/.gem/credentials | grep :rubygems_api_key | awk '{print $2}')`
|
58
|
+
|
59
|
+
Please look at [the Earthly documentation](https://docs.earthly.dev) for more.
|
60
|
+
|
51
61
|
## COPYRIGHT
|
52
62
|
|
53
63
|
See [LICENSE](LICENSE) for details.
|
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
24
|
spec.add_dependency 'database_cleaner-core', '~>2.0.0.beta2'
|
25
|
-
spec.add_dependency 'nobrainer'
|
25
|
+
spec.add_dependency 'nobrainer'
|
26
26
|
|
27
27
|
spec.add_development_dependency 'appraisal', '~> 2'
|
28
|
-
spec.add_development_dependency 'bundler'
|
28
|
+
spec.add_development_dependency 'bundler'
|
29
29
|
spec.add_development_dependency 'rake', '~> 13'
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3'
|
31
31
|
end
|
@@ -5,13 +5,16 @@ require 'database_cleaner/strategy'
|
|
5
5
|
module DatabaseCleaner
|
6
6
|
module Nobrainer
|
7
7
|
class Deletion < Strategy
|
8
|
-
def initialize(
|
9
|
-
|
10
|
-
|
8
|
+
def initialize(args = {})
|
9
|
+
raise ArgumentError if (args.keys - %i[only except]).size.positive?
|
10
|
+
|
11
|
+
@only = args[:only] || []
|
12
|
+
@except = args[:except] || []
|
11
13
|
end
|
12
14
|
|
13
15
|
def clean
|
14
|
-
|
16
|
+
res = collections_to_delete
|
17
|
+
res.each do |table_name|
|
15
18
|
NoBrainer.run do |r|
|
16
19
|
if db == :default
|
17
20
|
r.table(table_name).delete
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_cleaner-nobrainer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Hain
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: database_cleaner-core
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: nobrainer
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: appraisal
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
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: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,8 +110,6 @@ files:
|
|
110
110
|
- bin/console
|
111
111
|
- bin/setup
|
112
112
|
- database_cleaner-nobrainer.gemspec
|
113
|
-
- gemfiles/.bundle/config
|
114
|
-
- gemfiles/nobrainer0.gemfile
|
115
113
|
- lib/database_cleaner-nobrainer.rb
|
116
114
|
- lib/database_cleaner/nobrainer.rb
|
117
115
|
- lib/database_cleaner/nobrainer/deletion.rb
|
@@ -135,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
133
|
- !ruby/object:Gem::Version
|
136
134
|
version: '0'
|
137
135
|
requirements: []
|
138
|
-
rubygems_version: 3.1.
|
136
|
+
rubygems_version: 3.1.6
|
139
137
|
signing_key:
|
140
138
|
specification_version: 4
|
141
139
|
summary: Strategies for cleaning databases using Nobrainer.
|
data/gemfiles/.bundle/config
DELETED
data/gemfiles/nobrainer0.gemfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gem 'byebug'
|
6
|
-
gem 'database_cleaner-core', git: 'https://github.com/DatabaseCleaner/database_cleaner'
|
7
|
-
gem 'nobrainer', '~> 0.34'
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem 'codecov', require: false
|
11
|
-
gem 'simplecov', require: false
|
12
|
-
end
|
13
|
-
|
14
|
-
gemspec path: '../'
|