database_cleaner-mongo_mapper 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 +59 -0
- data/LICENSE.txt +21 -0
- data/README.md +57 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/database_cleaner-mongo_mapper.gemspec +30 -0
- data/lib/database_cleaner-mongo_mapper.rb +1 -0
- data/lib/database_cleaner/mongo_mapper.rb +4 -0
- data/lib/database_cleaner/mongo_mapper/base.rb +24 -0
- data/lib/database_cleaner/mongo_mapper/truncation.rb +19 -0
- data/lib/database_cleaner/mongo_mapper/version.rb +5 -0
- metadata +131 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4c665f47fb3b97273d4c02d684299015c6c84ef106a3675010499ae89acf7f98
|
4
|
+
data.tar.gz: 54bb5f28719ea8ad17d9b281735216d3e8506685133c6ec67bdc09e9ad5233d6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3e337ee94bf007904f8d42ac61a8a4fedec73782e2084d90396d6614502be23f0559732bef154bd9daf6b8af0dce3aebde0461ec4ae43c8cf29d6dac93f68c19
|
7
|
+
data.tar.gz: ad82c5d31d351238c2d8c648c4ea22e7b2a9184a86ae8f16ec8e946f22d846d47c2abcf3cfd474a2926bb4200cafd2a280697a6c97433da0ba543a618ca920c7
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
database_cleaner (1.8.0.beta)
|
5
|
+
|
6
|
+
PATH
|
7
|
+
remote: .
|
8
|
+
specs:
|
9
|
+
database_cleaner-mongo_mapper (1.8.0.beta)
|
10
|
+
database_cleaner (~> 1.8.0.beta)
|
11
|
+
mongo_mapper
|
12
|
+
|
13
|
+
GEM
|
14
|
+
remote: https://rubygems.org/
|
15
|
+
specs:
|
16
|
+
activemodel (3.0.0)
|
17
|
+
activesupport (= 3.0.0)
|
18
|
+
builder (~> 2.1.2)
|
19
|
+
i18n (~> 0.4.1)
|
20
|
+
activesupport (3.0.0)
|
21
|
+
bson (1.12.5)
|
22
|
+
builder (2.1.2)
|
23
|
+
diff-lcs (1.3)
|
24
|
+
i18n (0.4.2)
|
25
|
+
mongo (1.12.5)
|
26
|
+
bson (= 1.12.5)
|
27
|
+
mongo_mapper (0.12.0)
|
28
|
+
activemodel (~> 3.0)
|
29
|
+
activesupport (~> 3.0)
|
30
|
+
plucky (~> 0.5.2)
|
31
|
+
plucky (0.5.2)
|
32
|
+
mongo (~> 1.5)
|
33
|
+
rake (10.4.2)
|
34
|
+
rspec (3.7.0)
|
35
|
+
rspec-core (~> 3.7.0)
|
36
|
+
rspec-expectations (~> 3.7.0)
|
37
|
+
rspec-mocks (~> 3.7.0)
|
38
|
+
rspec-core (3.7.1)
|
39
|
+
rspec-support (~> 3.7.0)
|
40
|
+
rspec-expectations (3.7.0)
|
41
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
+
rspec-support (~> 3.7.0)
|
43
|
+
rspec-mocks (3.7.0)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.7.0)
|
46
|
+
rspec-support (3.7.1)
|
47
|
+
|
48
|
+
PLATFORMS
|
49
|
+
ruby
|
50
|
+
|
51
|
+
DEPENDENCIES
|
52
|
+
bundler (~> 1.16)
|
53
|
+
database_cleaner!
|
54
|
+
database_cleaner-mongo_mapper!
|
55
|
+
rake (~> 10.0)
|
56
|
+
rspec (~> 3.0)
|
57
|
+
|
58
|
+
BUNDLED WITH
|
59
|
+
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,57 @@
|
|
1
|
+
# Database Cleaner Adapter for MongoMapper
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongo_mapper.svg?branch=master)](https://travis-ci.org/DatabaseCleaner/database_cleaner-mongo_mapper)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongo_mapper/badges/gpa.svg)](https://codeclimate.com/github/DatabaseCleaner/database_cleaner-mongo_mapper)
|
5
|
+
|
6
|
+
Clean your MongoMapper 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-mongo_mapper'
|
16
|
+
end
|
17
|
+
```
|
18
|
+
|
19
|
+
## Supported Strategies
|
20
|
+
|
21
|
+
<table>
|
22
|
+
<tbody>
|
23
|
+
<tr>
|
24
|
+
<th>Truncation</th>
|
25
|
+
<th>Transaction</th>
|
26
|
+
<th>Deletion</th>
|
27
|
+
</tr>
|
28
|
+
<tr>
|
29
|
+
<td> <b>Yes</b></td>
|
30
|
+
<td> No</td>
|
31
|
+
<td> No</td>
|
32
|
+
</tr>
|
33
|
+
</tbody>
|
34
|
+
</table>
|
35
|
+
|
36
|
+
(Default strategy is denoted in bold)
|
37
|
+
|
38
|
+
## Configuration options
|
39
|
+
|
40
|
+
<table>
|
41
|
+
<tbody>
|
42
|
+
<tr>
|
43
|
+
<th>ORM</th>
|
44
|
+
<th>How to access</th>
|
45
|
+
<th>Notes</th>
|
46
|
+
</tr>
|
47
|
+
<tr>
|
48
|
+
<td> Mongo Mapper</td>
|
49
|
+
<td> <code>DatabaseCleaner[:mongo_mapper]</code></td>
|
50
|
+
<td> Multiple connections not yet supported</td>
|
51
|
+
</tr>
|
52
|
+
</tbody>
|
53
|
+
</table>
|
54
|
+
|
55
|
+
## COPYRIGHT
|
56
|
+
|
57
|
+
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/mongo_mapper"
|
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/mongo_mapper/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "database_cleaner-mongo_mapper"
|
8
|
+
spec.version = DatabaseCleaner::MongoMapper::VERSION
|
9
|
+
spec.authors = ["Ernesto Tagwerker"]
|
10
|
+
spec.email = ["ernesto@ombulabs.com"]
|
11
|
+
|
12
|
+
spec.summary = "Strategies for cleaning databases using MongoMapper. Can be used to ensure a clean state for testing."
|
13
|
+
spec.description = "Strategies for cleaning databases using MongoMapper. Can be used to ensure a clean state for testing."
|
14
|
+
spec.homepage = "https://github.com/DatabaseCleaner/database_cleaner-mongo_mapper"
|
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 "mongo_mapper"
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "database_cleaner/mongo_mapper"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'database_cleaner/generic/base'
|
2
|
+
module DatabaseCleaner
|
3
|
+
module MongoMapper
|
4
|
+
def self.available_strategies
|
5
|
+
%w[truncation]
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.default_strategy
|
9
|
+
:truncation
|
10
|
+
end
|
11
|
+
|
12
|
+
module Base
|
13
|
+
include ::DatabaseCleaner::Generic::Base
|
14
|
+
|
15
|
+
def db=(desired_db)
|
16
|
+
@db = desired_db
|
17
|
+
end
|
18
|
+
|
19
|
+
def db
|
20
|
+
@db ||= :default
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'database_cleaner/mongo_mapper/base'
|
2
|
+
require 'database_cleaner/generic/truncation'
|
3
|
+
require 'database_cleaner/mongo/truncation_mixin'
|
4
|
+
|
5
|
+
module DatabaseCleaner
|
6
|
+
module MongoMapper
|
7
|
+
class Truncation
|
8
|
+
include ::DatabaseCleaner::MongoMapper::Base
|
9
|
+
include ::DatabaseCleaner::Generic::Truncation
|
10
|
+
include ::DatabaseCleaner::Mongo::TruncationMixin
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def database
|
15
|
+
::MongoMapper.database
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: database_cleaner-mongo_mapper
|
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: mongo_mapper
|
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: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.16'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.16'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
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 MongoMapper. 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-mongo_mapper.gemspec
|
102
|
+
- lib/database_cleaner-mongo_mapper.rb
|
103
|
+
- lib/database_cleaner/mongo_mapper.rb
|
104
|
+
- lib/database_cleaner/mongo_mapper/base.rb
|
105
|
+
- lib/database_cleaner/mongo_mapper/truncation.rb
|
106
|
+
- lib/database_cleaner/mongo_mapper/version.rb
|
107
|
+
homepage: https://github.com/DatabaseCleaner/database_cleaner-mongo_mapper
|
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 MongoMapper. Can be used to ensure
|
130
|
+
a clean state for testing.
|
131
|
+
test_files: []
|