database_cleaner-couch_potato 1.8.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +80 -0
- data/LICENSE.txt +21 -0
- data/README.md +59 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +6 -0
- data/database_cleaner-couch_potato.gemspec +30 -0
- data/lib/database_cleaner-couch_potato.rb +1 -0
- data/lib/database_cleaner/couch_potato.rb +11 -0
- data/lib/database_cleaner/couch_potato/base.rb +7 -0
- data/lib/database_cleaner/couch_potato/truncation.rb +28 -0
- data/lib/database_cleaner/couch_potato/version.rb +5 -0
- metadata +131 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f5ad033f8671d097c6a5d52bd6c5159815ba2b8191b255135d1ae93e48cf3e57
|
4
|
+
data.tar.gz: 289b879a0abfa928c4e4a3fdd476b9d12ae229cafa291b669fdc5b9f222be6f0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eda3614a342cb28aea4bf1fbb1d88d4a6c3e13d4fe4f4515effbb330b2612ea2412fb26ffad576765312c4fdf3b739ebbe85135821ee8122df44fc70cd89f25d
|
7
|
+
data.tar.gz: 49d2ab00d8d787e24d89071e1dd4e73a6e92472486d670bc8dec9a2ec492c988bc4e96305fd9364c889cac14abfc1f6b19c057de187771abefe79231352f9d5c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
database_cleaner (1.8.0.beta)
|
5
|
+
|
6
|
+
PATH
|
7
|
+
remote: .
|
8
|
+
specs:
|
9
|
+
database_cleaner-couch_potato (1.8.0.beta)
|
10
|
+
couch_potato
|
11
|
+
database_cleaner (~> 1.8.0.beta)
|
12
|
+
|
13
|
+
GEM
|
14
|
+
remote: https://rubygems.org/
|
15
|
+
specs:
|
16
|
+
activemodel (5.2.4.1)
|
17
|
+
activesupport (= 5.2.4.1)
|
18
|
+
activesupport (5.2.4.1)
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
|
+
i18n (>= 0.7, < 2)
|
21
|
+
minitest (~> 5.1)
|
22
|
+
tzinfo (~> 1.1)
|
23
|
+
concurrent-ruby (1.1.5)
|
24
|
+
couch_potato (1.3.0)
|
25
|
+
activemodel
|
26
|
+
couchrest (~> 1.2.0)
|
27
|
+
json (~> 1.6)
|
28
|
+
couchrest (1.2.1)
|
29
|
+
mime-types (>= 1.15)
|
30
|
+
multi_json (~> 1.7, ~> 1.0)
|
31
|
+
rest-client (~> 1.8.0)
|
32
|
+
diff-lcs (1.3)
|
33
|
+
domain_name (0.5.20180417)
|
34
|
+
unf (>= 0.0.5, < 1.0.0)
|
35
|
+
http-cookie (1.0.3)
|
36
|
+
domain_name (~> 0.5)
|
37
|
+
i18n (1.5.1)
|
38
|
+
concurrent-ruby (~> 1.0)
|
39
|
+
json (1.8.6)
|
40
|
+
mime-types (2.99.3)
|
41
|
+
minitest (5.14.0)
|
42
|
+
multi_json (1.14.1)
|
43
|
+
netrc (0.11.0)
|
44
|
+
rake (10.4.2)
|
45
|
+
rest-client (1.8.0)
|
46
|
+
http-cookie (>= 1.0.2, < 2.0)
|
47
|
+
mime-types (>= 1.16, < 3.0)
|
48
|
+
netrc (~> 0.7)
|
49
|
+
rspec (3.7.0)
|
50
|
+
rspec-core (~> 3.7.0)
|
51
|
+
rspec-expectations (~> 3.7.0)
|
52
|
+
rspec-mocks (~> 3.7.0)
|
53
|
+
rspec-core (3.7.1)
|
54
|
+
rspec-support (~> 3.7.0)
|
55
|
+
rspec-expectations (3.7.0)
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
+
rspec-support (~> 3.7.0)
|
58
|
+
rspec-mocks (3.7.0)
|
59
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
+
rspec-support (~> 3.7.0)
|
61
|
+
rspec-support (3.7.1)
|
62
|
+
thread_safe (0.3.6)
|
63
|
+
tzinfo (1.2.6)
|
64
|
+
thread_safe (~> 0.1)
|
65
|
+
unf (0.1.4)
|
66
|
+
unf_ext
|
67
|
+
unf_ext (0.0.7.5)
|
68
|
+
|
69
|
+
PLATFORMS
|
70
|
+
ruby
|
71
|
+
|
72
|
+
DEPENDENCIES
|
73
|
+
bundler (~> 1.16)
|
74
|
+
database_cleaner!
|
75
|
+
database_cleaner-couch_potato!
|
76
|
+
rake (~> 10.0)
|
77
|
+
rspec (~> 3.0)
|
78
|
+
|
79
|
+
BUNDLED WITH
|
80
|
+
1.17.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2009 Ben Mabey
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# Database Cleaner Adapter for CouchPotato
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-couch_potato.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-couch_potato)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-couch_potato/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-couch_potato)
|
5
|
+
|
6
|
+
Clean your CouchPotato databases with Database Cleaner.
|
7
|
+
|
8
|
+
See https://github.com/DatabaseCleaner/database_cleaner for more information.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
# Gemfile
|
14
|
+
group :test do
|
15
|
+
gem 'database_cleaner-couch_potato'
|
16
|
+
end
|
17
|
+
```
|
18
|
+
|
19
|
+
## Supported Strategies
|
20
|
+
|
21
|
+
Here is an overview of the supported strategies:
|
22
|
+
|
23
|
+
<table>
|
24
|
+
<tbody>
|
25
|
+
<tr>
|
26
|
+
<th>Truncation</th>
|
27
|
+
<th>Transaction</th>
|
28
|
+
<th>Deletion</th>
|
29
|
+
</tr>
|
30
|
+
<tr>
|
31
|
+
<td> <b>Yes</b></td>
|
32
|
+
<td> No</td>
|
33
|
+
<td> No</td>
|
34
|
+
</tr>
|
35
|
+
</tbody>
|
36
|
+
</table>
|
37
|
+
|
38
|
+
(Default strategy is denoted in bold)
|
39
|
+
|
40
|
+
## Configuration options
|
41
|
+
|
42
|
+
<table>
|
43
|
+
<tbody>
|
44
|
+
<tr>
|
45
|
+
<th>ORM</th>
|
46
|
+
<th>How to access</th>
|
47
|
+
<th>Notes</th>
|
48
|
+
</tr>
|
49
|
+
<tr>
|
50
|
+
<td> Couch Potato</td>
|
51
|
+
<td> <code>DatabaseCleaner[:couch_potato]</code></td>
|
52
|
+
<td> Multiple connections not yet supported</td>
|
53
|
+
</tr>
|
54
|
+
</tbody>
|
55
|
+
</table>
|
56
|
+
|
57
|
+
## COPYRIGHT
|
58
|
+
|
59
|
+
See [LICENSE] for details.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "database_cleaner/couch_potato"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "database_cleaner/couch_potato/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "database_cleaner-couch_potato"
|
8
|
+
spec.version = DatabaseCleaner::CouchPotato::VERSION
|
9
|
+
spec.authors = ["Ernesto Tagwerker"]
|
10
|
+
spec.email = ["ernesto@ombulabs.com"]
|
11
|
+
|
12
|
+
spec.summary = "Strategies for cleaning databases using CouchPotato. Can be used to ensure a clean state for testing."
|
13
|
+
spec.description = "Strategies for cleaning databases using CouchPotato. Can be used to ensure a clean state for testing."
|
14
|
+
spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-couch_potato"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "database_cleaner", "~> 1.8.0.beta"
|
25
|
+
spec.add_dependency "couch_potato"
|
26
|
+
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "database_cleaner/couch_potato"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "database_cleaner/couch_potato/version"
|
2
|
+
require "database_cleaner"
|
3
|
+
require "database_cleaner/couch_potato/base"
|
4
|
+
require "database_cleaner/couch_potato/truncation"
|
5
|
+
|
6
|
+
module DatabaseCleaner::CouchPotato
|
7
|
+
def self.default_strategy
|
8
|
+
:truncation
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'database_cleaner/generic/truncation'
|
2
|
+
|
3
|
+
module DatabaseCleaner
|
4
|
+
module CouchPotato
|
5
|
+
class Truncation
|
6
|
+
include ::DatabaseCleaner::Generic::Truncation
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
if options.has_key?(:only) || options.has_key?(:except)
|
10
|
+
raise ArgumentError, "The :only and :except options are not available for use with CouchPotato/CouchDB."
|
11
|
+
elsif !options.empty?
|
12
|
+
raise ArgumentError, "Unsupported option. You specified #{options.keys.join(',')}."
|
13
|
+
end
|
14
|
+
super
|
15
|
+
end
|
16
|
+
|
17
|
+
def clean
|
18
|
+
database.recreate!
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def database
|
24
|
+
::CouchPotato.couchrest_database
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: database_cleaner-couch_potato
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.8.0.beta
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ernesto Tagwerker
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: database_cleaner
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.8.0.beta
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.8.0.beta
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: couch_potato
|
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'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.16'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.16'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
description: Strategies for cleaning databases using CouchPotato. Can be used to ensure
|
84
|
+
a clean state for testing.
|
85
|
+
email:
|
86
|
+
- ernesto@ombulabs.com
|
87
|
+
executables: []
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- ".travis.yml"
|
94
|
+
- Gemfile
|
95
|
+
- Gemfile.lock
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- bin/console
|
100
|
+
- bin/setup
|
101
|
+
- database_cleaner-couch_potato.gemspec
|
102
|
+
- lib/database_cleaner-couch_potato.rb
|
103
|
+
- lib/database_cleaner/couch_potato.rb
|
104
|
+
- lib/database_cleaner/couch_potato/base.rb
|
105
|
+
- lib/database_cleaner/couch_potato/truncation.rb
|
106
|
+
- lib/database_cleaner/couch_potato/version.rb
|
107
|
+
homepage: https://github.com/DatabaseCleaner/database_cleaner-couch_potato
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.3.1
|
125
|
+
requirements: []
|
126
|
+
rubygems_version: 3.0.4
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Strategies for cleaning databases using CouchPotato. Can be used to ensure
|
130
|
+
a clean state for testing.
|
131
|
+
test_files: []
|