database_cleaner-sequel 2.0.0.beta → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/database_cleaner-sequel.gemspec +1 -1
- data/lib/database_cleaner/sequel/truncation.rb +4 -4
- data/lib/database_cleaner/sequel/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 640dc9a9fc652d82f4c1e14837648cac2bd9346ddfd6bd12a87a2f67e1008f87
|
4
|
+
data.tar.gz: b3938c9b01e1b8975d92d39bde27d9fc4c6af2649020a1335f50648636a510d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5070f411181f2d1085342f7288193b3e04c600858da0bd0895c5368aa41447c6ed818d5dad9888a7bd3363c7e70be7bcf8bc01835a377582eaf261058f0cd03e
|
7
|
+
data.tar.gz: b5844519977037d3e685df0ebc1b0888eede7a3a54e5ab6c78c3cf9aabce1b9d538d8dab46273b3db766c5eca0efacb2ace654a0b1d64751704769e5b6a7193d
|
data/README.md
CHANGED
@@ -50,10 +50,10 @@ The truncation and deletion strategies may accept the following options:
|
|
50
50
|
|
51
51
|
```ruby
|
52
52
|
# Only truncate the "users" table.
|
53
|
-
DatabaseCleaner[:sequel].strategy = :truncation,
|
53
|
+
DatabaseCleaner[:sequel].strategy = :truncation, only: ["users"]
|
54
54
|
|
55
55
|
# Delete all tables except the "users" table.
|
56
|
-
DatabaseCleaner[:sequel].strategy = :deletion,
|
56
|
+
DatabaseCleaner[:sequel].strategy = :deletion, except: ["users"]
|
57
57
|
```
|
58
58
|
|
59
59
|
* `:pre_count` - When set to `true`, this will check each table for existing rows before truncating or deleting it. This can speed up test suites when many of the tables are never populated. Defaults to `false`.
|
@@ -70,8 +70,8 @@ DatabaseCleaner[:sequel].db = Sequel.connect(uri)
|
|
70
70
|
DatabaseCleaner[:sequel].db = :default
|
71
71
|
|
72
72
|
# Multiple Sequel databases can be specified:
|
73
|
-
DatabaseCleaner[:sequel,
|
74
|
-
DatabaseCleaner[:sequel,
|
73
|
+
DatabaseCleaner[:sequel, db: :default]
|
74
|
+
DatabaseCleaner[:sequel, db: Sequel.connect(uri)]
|
75
75
|
```
|
76
76
|
## COPYRIGHT
|
77
77
|
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "database_cleaner-core", "~>2.0.0
|
21
|
+
spec.add_dependency "database_cleaner-core", "~>2.0.0"
|
22
22
|
spec.add_dependency "sequel"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler"
|
@@ -3,10 +3,10 @@ require 'database_cleaner/sequel/base'
|
|
3
3
|
module DatabaseCleaner
|
4
4
|
module Sequel
|
5
5
|
class Truncation < Base
|
6
|
-
def initialize
|
7
|
-
@only = only
|
8
|
-
@except = except
|
9
|
-
@pre_count = pre_count
|
6
|
+
def initialize(opts = {})
|
7
|
+
@only = opts[:only] || []
|
8
|
+
@except = opts[:except] || []
|
9
|
+
@pre_count = opts[:pre_count] || false
|
10
10
|
end
|
11
11
|
|
12
12
|
def start
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_cleaner-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernesto Tagwerker
|
8
8
|
- Micah Geisel
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-03-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: database_cleaner-core
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 2.0.0
|
20
|
+
version: 2.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 2.0.0
|
27
|
+
version: 2.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: sequel
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,7 +154,7 @@ homepage: https://github.com/DatabaseCleaner/database_cleaner-sequel
|
|
154
154
|
licenses:
|
155
155
|
- MIT
|
156
156
|
metadata: {}
|
157
|
-
post_install_message:
|
157
|
+
post_install_message:
|
158
158
|
rdoc_options: []
|
159
159
|
require_paths:
|
160
160
|
- lib
|
@@ -165,12 +165,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
167
|
requirements:
|
168
|
-
- - "
|
168
|
+
- - ">="
|
169
169
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
170
|
+
version: '0'
|
171
171
|
requirements: []
|
172
|
-
rubygems_version: 3.
|
173
|
-
signing_key:
|
172
|
+
rubygems_version: 3.1.3
|
173
|
+
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: Strategies for cleaning databases using Sequel. Can be used to ensure a clean
|
176
176
|
state for testing.
|