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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffc70a387238a97f6ee167a44bde8bb60e5bfc79d0c2cfee8359b005e3d85d81
4
- data.tar.gz: '08ad8900378e0d8c409beac82997afaf85f5c7fd4aa89516307320c132344ed6'
3
+ metadata.gz: a661979e7c9de6be0404809646eeb7fbc0d49ff6dfac05def272dc6fef434919
4
+ data.tar.gz: a0768b2e7ec81e73cc543662a09ac5c30ed6b18da0561550d58f2b5d3b8fad02
5
5
  SHA512:
6
- metadata.gz: 947434d9de3d4384becf599b3fd544e34f1b9a3cf1db2f645e02b09af8c3c7515d8bae6aa7bcc103e39b6f734492699100caf1dfbcb310ae3dc13a9a1dfd9789
7
- data.tar.gz: 263f018e5b51c4f5396dce94824edaac5a8f6fbd5f2094c513317531a111b8d4603bf324ff2252a55dd9e224c527b574d0f2f20cbd43792478338c7999145c37
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: 855abc968d6ec1bf86b5c2a90687c53151794a0d
3
+ revision: 068656a246fcb56ab1385e7370b2740f5ebef5db
4
4
  specs:
5
- database_cleaner-core (2.0.0.beta2)
5
+ database_cleaner-core (2.0.1)
6
6
 
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- database_cleaner-nobrainer (1.0.0)
10
+ database_cleaner-nobrainer (1.1.0)
11
11
  database_cleaner-core (~> 2.0.0.beta2)
12
- nobrainer (~> 0.30)
12
+ nobrainer
13
13
 
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- activemodel (6.0.3.3)
18
- activesupport (= 6.0.3.3)
19
- activesupport (6.0.3.3)
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 (>= 0.7, < 2)
22
- minitest (~> 5.1)
23
- tzinfo (~> 1.1)
24
- zeitwerk (~> 2.2, >= 2.2.2)
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.2.11)
31
- json
32
- simplecov
33
- concurrent-ruby (1.1.7)
34
- diff-lcs (1.4.4)
35
- docile (1.3.2)
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.14.2)
41
- nobrainer (0.34.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.1)
44
+ rake (13.0.6)
48
45
  rethinkdb (2.4.0.0)
49
- rspec (3.9.0)
50
- rspec-core (~> 3.9.0)
51
- rspec-expectations (~> 3.9.0)
52
- rspec-mocks (~> 3.9.0)
53
- rspec-core (3.9.3)
54
- rspec-support (~> 3.9.3)
55
- rspec-expectations (3.9.2)
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.9.0)
58
- rspec-mocks (3.9.1)
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.9.0)
61
- rspec-support (3.9.3)
62
- simplecov (0.19.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.0.1)
68
- thread_safe (0.3.6)
69
- tzinfo (1.2.7)
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 (~> 2)
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
- [![Build Status](https://travis-ci.com/zedtux/database_cleaner-nobrainer.svg?branch=master)](https://travis-ci.com/zedtux/database_cleaner-nobrainer)
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', '~> 0.30'
25
+ spec.add_dependency 'nobrainer'
26
26
 
27
27
  spec.add_development_dependency 'appraisal', '~> 2'
28
- spec.add_development_dependency 'bundler', '~> 2'
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(only: [], except: [])
9
- @only = only
10
- @except = except
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
- collections_to_delete.each do |table_name|
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module DatabaseCleaner
4
4
  module Nobrainer
5
- VERSION = '1.0.0'
5
+ VERSION = '1.1.0'
6
6
  end
7
7
  end
@@ -1,3 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0')
4
+ class Numeric
5
+ def positive?
6
+ self > 0 # rubocop:disable Style/NumericPredicate
7
+ end
8
+ end
9
+ end
10
+
3
11
  require 'database_cleaner/nobrainer'
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.0.0
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: 2020-10-06 00:00:00.000000000 Z
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.30'
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.30'
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: '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: '2'
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.4
136
+ rubygems_version: 3.1.6
139
137
  signing_key:
140
138
  specification_version: 4
141
139
  summary: Strategies for cleaning databases using Nobrainer.
@@ -1,2 +0,0 @@
1
- ---
2
- BUNDLE_RETRY: "1"
@@ -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: '../'