database_flusher 0.1.1 → 0.2.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
  SHA1:
3
- metadata.gz: 43b8589940f4be6cf29476431a5a59fefce4b3e5
4
- data.tar.gz: a1d467168f8d33c47b0681d04b57fd58cc51f2a4
3
+ metadata.gz: 4ae582039a16a7f6b25c12b09683663d3061c9fb
4
+ data.tar.gz: ee031d973bf006c2640d8bae58b8aee97457c617
5
5
  SHA512:
6
- metadata.gz: b7d0f5e9c7375dc85199d07f063b11744a3395e3cfbc0d432126ac84996e23600f68aae2673bd68d237942b242a393cf9d16f3085912cad3fbe67dee33f6dd08
7
- data.tar.gz: d9a54465da056726d13f7800f79d9af1f8abf81b148d2d1b09532ba2dadb1256d8e0fddcdf0e1dc371489cc1efbd47a65bbdc666a65b2d1ca89985e7a8ac0202
6
+ metadata.gz: 489db40d248249811e8f16420dfda4c02a2e3b42bd2c709028061b371c8efcc3b2ab4c8e584a9f0c0f687396ce3aeb881fb5195933c9954409fb3d72f2774e5c
7
+ data.tar.gz: 9b039b7933fa803c298719792e74f5255c4b4f13e6310207777fe35c32dcd7580b833430e13763b3a5891673abee6fd4fe603219e4ed6ec90a90c12949fcf73a
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /*.gem
11
+ /.byebug_history
data/.travis.yml CHANGED
@@ -1,5 +1,17 @@
1
1
  sudo: false
2
2
  language: ruby
3
+ cache: bundler
4
+
5
+ services:
6
+ - mongodb
7
+
3
8
  rvm:
4
9
  - 2.2.4
10
+ - 2.3.3
11
+
12
+ env:
13
+ - DB=sqlite3
14
+ - DB=mysql2
15
+ - DB=postgresql
16
+
5
17
  before_install: gem install bundler -v 1.13.3
data/README.md CHANGED
@@ -1,8 +1,23 @@
1
1
  # DatabaseFlusher
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/database_flusher`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Build Status](https://travis-ci.org/ebeigarts/database_flusher.svg?branch=master)](https://travis-ci.org/ebeigarts/database_flusher)
4
+
5
+ database_flusher is a tiny and fast database cleaner inspired by [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) and [database_rewinder](https://github.com/amatsuda/database_rewinder).
6
+
7
+ ## Features
8
+
9
+ * No monkey patching - uses `ActiveSupport::Notifications` and `Mongo::Monitoring::Global` to catch `INSERT` statements
10
+ * Fast `:deletion` strategy that cleans only tables/collections where `INSERT` statements were performed
11
+ * Faster `disable_referential_integrity` for PostgreSQL
12
+ * Executes multiple `DELETE` statements as one query with ActiveRecord
13
+
14
+ ## Supported ORMs and strategies
15
+
16
+ | ORM | Deletion | Transaction |
17
+ |:-------------|:---------|:------------|
18
+ | ActiveRecord | Yes | Yes |
19
+ | Mongoid | Yes | No |
4
20
 
5
- TODO: Delete this and the text above, and describe your gem
6
21
 
7
22
  ## Installation
8
23
 
@@ -14,28 +29,68 @@ gem 'database_flusher'
14
29
 
15
30
  And then execute:
16
31
 
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install database_flusher
32
+ ```bash
33
+ $ bundle
34
+ ```
22
35
 
23
36
  ## Usage
24
37
 
25
- TODO: Write usage instructions here
38
+ RSpec:
26
39
 
27
- ## Development
40
+ ```ruby
41
+ RSpec.configure do |config|
42
+ config.use_transactional_fixtures = false
43
+
44
+ config.before :suite do
45
+ DatabaseFlusher[:active_record].strategy = :transaction
46
+ DatabaseFlusher[:mongoid].strategy = :deletion
47
+ end
48
+
49
+ config.before :each do
50
+ DatabaseFlusher[:active_record].strategy = :transaction
51
+ end
52
+
53
+ config.before :each, type: :feature do
54
+ if Capybara.current_driver != :rack_test
55
+ DatabaseFlusher[:active_record].strategy = :deletion
56
+ end
57
+ end
58
+
59
+ config.before :each do
60
+ DatabaseFlusher.start
61
+ end
62
+
63
+ config.append_after :each do
64
+ DatabaseFlusher.clean
65
+ end
66
+ end
67
+ ```
28
68
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
69
+ Cucumber:
30
70
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
71
+ ```ruby
72
+ DatabaseFlusher[:active_record].strategy = :transaction
73
+ DatabaseFlusher[:mongoid].strategy = :deletion
74
+
75
+ Before('~@javascript') do
76
+ DatabaseFlusher[:active_record].strategy = :transaction
77
+ DatabaseFlusher.start
78
+ end
79
+
80
+ Before('@javascript') do
81
+ DatabaseFlusher[:active_record].strategy = :deletion
82
+ DatabaseFlusher.start
83
+ end
84
+
85
+ After do
86
+ DatabaseFlusher.clean
87
+ end
88
+ ```
32
89
 
33
90
  ## Contributing
34
91
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/database_flusher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
92
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ebeigarts/database_flusher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
37
93
 
38
94
  ## License
39
95
 
40
96
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
@@ -4,22 +4,32 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'database_flusher/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "database_flusher"
7
+ spec.name = 'database_flusher'
8
8
  spec.version = DatabaseFlusher::VERSION
9
- spec.authors = ["Edgars Beigarts"]
10
- spec.email = ["edgars.beigarts@gmail.com"]
9
+ spec.authors = ['Edgars Beigarts']
10
+ spec.email = ['edgars.beigarts@gmail.com']
11
11
 
12
12
  spec.summary = %q{super-fast database cleaner}
13
13
  spec.description = spec.summary
14
- spec.homepage = "https://github.com/ebeigarts/database_flusher"
15
- spec.license = "MIT"
14
+ spec.homepage = 'https://github.com/ebeigarts/database_flusher'
15
+ spec.license = 'MIT'
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
18
  f.match(%r{^(test|spec|features)/})
19
19
  end
20
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ['lib']
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.13"
23
- spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "rspec", "~> 3.0"
22
+ spec.required_ruby_version = '>= 2.2.1'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.13'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.0'
27
+ spec.add_development_dependency 'byebug'
28
+
29
+ spec.add_development_dependency 'activerecord'
30
+ spec.add_development_dependency 'sqlite3'
31
+ spec.add_development_dependency 'mysql2'
32
+ spec.add_development_dependency 'pg'
33
+
34
+ spec.add_development_dependency 'mongoid'
25
35
  end
@@ -0,0 +1,40 @@
1
+ module DatabaseFlusher
2
+ module ActiveRecord
3
+ class AbstractAdapter
4
+ attr_reader :connection, :raw_connection
5
+
6
+ def initialize(connection)
7
+ @connection = connection
8
+ @raw_connection = connection.raw_connection
9
+ end
10
+
11
+ def delete(*tables)
12
+ disable_referential_integrity(*tables) do
13
+ stmts = tables.map do |name|
14
+ "DELETE FROM #{quote_table_name(name)}"
15
+ end
16
+ sql = stmts.join(';')
17
+ execute_multi sql
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def execute_multi(sql)
24
+ connection.execute sql
25
+ end
26
+
27
+ def execute(sql)
28
+ connection.execute sql
29
+ end
30
+
31
+ def quote_table_name(name)
32
+ connection.quote_table_name(name)
33
+ end
34
+
35
+ def disable_referential_integrity(*tables, &block)
36
+ connection.disable_referential_integrity(&block)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,25 @@
1
+ module DatabaseFlusher
2
+ module ActiveRecord
3
+ class Mysql2Adapter < AbstractAdapter
4
+ def initialize(connection)
5
+ super
6
+ flags = raw_connection.query_options[:flags]
7
+ unless flags.include?('MULTI_STATEMENTS'.freeze)
8
+ raise 'MULTI_STATEMENTS flag is not enabled'
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def execute_multi(sql)
15
+ connection.disable_referential_integrity do
16
+ _result = raw_connection.query sql
17
+ while raw_connection.next_result
18
+ # just to make sure that all queries are finished
19
+ _result = raw_connection.store_result
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ module DatabaseFlusher
2
+ module ActiveRecord
3
+ class PostgreSQLAdapter < AbstractAdapter
4
+ private
5
+
6
+ def disable_referential_integrity(*tables, &block)
7
+ begin
8
+ execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER ALL" }.join(";"))
9
+ rescue
10
+ execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} DISABLE TRIGGER USER" }.join(";"))
11
+ end
12
+ yield
13
+ ensure
14
+ begin
15
+ execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER ALL" }.join(";"))
16
+ rescue
17
+ execute(tables.collect { |name| "ALTER TABLE #{quote_table_name(name)} ENABLE TRIGGER USER" }.join(";"))
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ module DatabaseFlusher
2
+ module ActiveRecord
3
+ class SQLiteAdapter < AbstractAdapter
4
+ private
5
+
6
+ def execute_multi(sql)
7
+ raw_connection.execute_batch sql
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,59 @@
1
+ require 'database_flusher/active_record/adapters/abstract_adapter'
2
+ require 'database_flusher/active_record/adapters/mysql2_adapter'
3
+ require 'database_flusher/active_record/adapters/postgresql_adapter'
4
+ require 'database_flusher/active_record/adapters/sqlite_adapter'
5
+
6
+ module DatabaseFlusher
7
+ module ActiveRecord
8
+ class DeletionStrategy
9
+ attr_reader :tables, :adapter
10
+
11
+ class Subscriber
12
+ def initialize(strategy)
13
+ @strategy = strategy
14
+ end
15
+
16
+ def call(_, _, _, _, payload)
17
+ sql = payload[:sql]
18
+ match = sql.match(/\A\s*INSERT(?:\s+IGNORE)?(?:\s+INTO)?\s+(?:\.*[`"]?([^.\s`"]+)[`"]?)*/i)
19
+ return unless match
20
+ table = match[1]
21
+ if table
22
+ @strategy.tables << table
23
+ end
24
+ end
25
+ end
26
+
27
+ def initialize
28
+ @tables = Set.new
29
+ end
30
+
31
+ def start
32
+ @subscriber ||= ActiveSupport::Notifications.subscribe(
33
+ 'sql.active_record',
34
+ Subscriber.new(self)
35
+ )
36
+ connection = ::ActiveRecord::Base.connection
37
+ @adapter = DatabaseFlusher::ActiveRecord.
38
+ const_get("#{connection.adapter_name}Adapter").
39
+ new(connection)
40
+ end
41
+
42
+ def stop
43
+ if @subscriber
44
+ ActiveSupport::Notifications.unsubscribe(@subscriber)
45
+ @subscriber = nil
46
+ end
47
+ end
48
+
49
+ def clean
50
+ return if tables.empty?
51
+
52
+ # puts "Cleaning #{tables.inspect}"
53
+ adapter.delete(*tables)
54
+
55
+ tables.clear
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,24 @@
1
+ module DatabaseFlusher
2
+ module ActiveRecord
3
+ class TransactionStrategy
4
+ def start
5
+ # Hack to make sure that the connection is properly setup for
6
+ # the clean code.
7
+ ::ActiveRecord::Base.connection.transaction{ }
8
+
9
+ ::ActiveRecord::Base.connection.begin_transaction joinable: false
10
+ end
11
+
12
+ def stop
13
+ ::ActiveRecord::Base.connection_pool.connections.each do |connection|
14
+ next unless connection.open_transactions > 0
15
+ connection.rollback_transaction
16
+ end
17
+ end
18
+
19
+ def clean
20
+ stop
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,57 @@
1
+ module DatabaseFlusher
2
+ class Cleaner
3
+ attr_reader :strategy
4
+
5
+ def initialize(orm)
6
+ @orm = orm
7
+ reset_strategy
8
+ end
9
+
10
+ def strategy=(name)
11
+ strategy_changed = name != @strategy_name
12
+
13
+ stop if strategy_changed
14
+
15
+ if name
16
+ create_strategy(name) if strategy_changed
17
+ else
18
+ reset_strategy
19
+ end
20
+ end
21
+
22
+ def clean_with(name)
23
+ self.strategy = name
24
+ strategy.clean
25
+ end
26
+
27
+ def start
28
+ strategy.start
29
+ end
30
+
31
+ def stop
32
+ strategy.stop
33
+ end
34
+
35
+ def clean
36
+ strategy.clean
37
+ end
38
+
39
+ private
40
+
41
+ def create_strategy(name)
42
+ @strategy_name = name
43
+ @strategy = DatabaseFlusher.
44
+ const_get(classify(@orm)).
45
+ const_get("#{classify(name)}Strategy").new
46
+ end
47
+
48
+ def reset_strategy
49
+ @strategy_name = nil
50
+ @strategy = DatabaseFlusher::NullStrategy.new
51
+ end
52
+
53
+ def classify(name)
54
+ name.to_s.split('_').collect(&:capitalize).join
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,52 @@
1
+ module DatabaseFlusher
2
+ module Mongoid
3
+ class DeletionStrategy
4
+ attr_reader :collections
5
+
6
+ class Subscriber
7
+ def initialize(strategy)
8
+ @strategy = strategy
9
+ end
10
+
11
+ def started(event)
12
+ if event.command_name == :insert || event.command_name == 'insert'.freeze
13
+ collection = event.command['insert'.freeze]
14
+ if collection
15
+ @strategy.collections << collection
16
+ end
17
+ end
18
+ end
19
+
20
+ private
21
+
22
+ def method_missing(*args, &block)
23
+ end
24
+ end
25
+
26
+ def initialize
27
+ @collections = Set.new
28
+ end
29
+
30
+ def start
31
+ @subscriber ||= Mongo::Monitoring::Global.subscribe(
32
+ Mongo::Monitoring::COMMAND,
33
+ Subscriber.new(self)
34
+ )
35
+ end
36
+
37
+ def stop
38
+ raise NotImplementedError, "Mongo doesn't provide unsubscribe"
39
+ end
40
+
41
+ def clean
42
+ return if collections.empty?
43
+ # puts "Cleaning #{collections.inspect}"
44
+ collections.each do |name|
45
+ client = ::Mongoid::Clients.default
46
+ client[name].delete_many
47
+ end
48
+ collections.clear
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,7 @@
1
+ module DatabaseFlusher
2
+ class NullStrategy
3
+ def start; end
4
+ def stop; end
5
+ def clean; end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module DatabaseFlusher
2
- VERSION = "0.1.1"
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -1,5 +1,12 @@
1
- require "database_flusher/version"
2
- require "set"
1
+ require 'set'
2
+
3
+ require 'database_flusher/version'
4
+ require 'database_flusher/null_strategy'
5
+ require 'database_flusher/cleaner'
6
+
7
+ require 'database_flusher/active_record/deletion_strategy'
8
+ require 'database_flusher/active_record/transaction_strategy'
9
+ require 'database_flusher/mongoid/deletion_strategy'
3
10
 
4
11
  module DatabaseFlusher
5
12
  extend self
@@ -8,96 +15,19 @@ module DatabaseFlusher
8
15
  @cleaners ||= {}
9
16
  end
10
17
 
11
- # TODO: classify
12
18
  def [](name)
13
- cleaners[name] ||= DatabaseFlusher.const_get("#{name.to_s.classify}Cleaner").new
14
- end
15
-
16
- def clean
17
- cleaners.values.each { |cleaner| cleaner.clean }
18
- end
19
-
20
- class MongoSubscriber
21
- def initialize(cleaner)
22
- @cleaner = cleaner
23
- end
24
-
25
- def started(event)
26
- if event.command_name == :insert || event.command_name == 'insert'.freeze
27
- collection = event.command['insert'.freeze]
28
- if collection
29
- @cleaner.collections << collection
30
- end
31
- end
32
- end
33
-
34
- private
35
-
36
- def method_missing(*args, &block)
37
- # puts args.inspect
38
- end
19
+ cleaners[name] ||= DatabaseFlusher::Cleaner.new(name)
39
20
  end
40
21
 
41
- class MongoCleaner
42
- attr_accessor :strategy
43
- attr_reader :collections
44
-
45
- def initialize
46
- @collections = Set.new
47
- Mongo::Monitoring::Global.subscribe(
48
- Mongo::Monitoring::COMMAND,
49
- MongoSubscriber.new(self)
50
- )
51
- end
52
-
53
- def clean
54
- return unless strategy
55
- client = Mongoid::Clients.default
56
- # puts "Cleaning #{collections.inspect}"
57
- collections.each do |name|
58
- client[name].delete_many
59
- end
60
- collections.clear
61
- end
22
+ def start
23
+ cleaners.values.each(&:start)
62
24
  end
63
25
 
64
- class ActiveRecordSubscriber
65
- def initialize(cleaner)
66
- @cleaner = cleaner
67
- end
68
-
69
- def call(_, _, _, _, payload)
70
- sql = payload[:sql]
71
- match = sql.match(/\A\s*INSERT(?:\s+IGNORE)?(?:\s+INTO)?\s+(?:\.*[`"]?([^.\s`"]+)[`"]?)*/i)
72
- return unless match
73
- table = match[1]
74
- if table
75
- @cleaner.tables << table
76
- end
77
- end
26
+ def stop
27
+ cleaners.values.each(&:stop)
78
28
  end
79
29
 
80
- class ActiveRecordCleaner
81
- attr_accessor :strategy
82
- attr_reader :tables
83
-
84
- def initialize
85
- @tables = Set.new
86
- ActiveSupport::Notifications.subscribe(
87
- 'sql.active_record',
88
- ActiveRecordSubscriber.new(self)
89
- )
90
- end
91
-
92
- def clean
93
- return unless strategy
94
- connection = ActiveRecord::Base.connection
95
- # puts "Cleaning #{tables.inspect}"
96
- connection.disable_referential_integrity do
97
- stmts = tables.map { |t| "DELETE FROM #{connection.quote_table_name(t)}" }
98
- connection.execute stmts.join('; ')
99
- end
100
- tables.clear
101
- end
30
+ def clean
31
+ cleaners.values.each(&:clean)
102
32
  end
103
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_flusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgars Beigarts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-09 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,90 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activerecord
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: sqlite3
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: mysql2
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pg
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: mongoid
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
55
139
  description: super-fast database cleaner
56
140
  email:
57
141
  - edgars.beigarts@gmail.com
@@ -71,6 +155,15 @@ files:
71
155
  - bin/setup
72
156
  - database_flusher.gemspec
73
157
  - lib/database_flusher.rb
158
+ - lib/database_flusher/active_record/adapters/abstract_adapter.rb
159
+ - lib/database_flusher/active_record/adapters/mysql2_adapter.rb
160
+ - lib/database_flusher/active_record/adapters/postgresql_adapter.rb
161
+ - lib/database_flusher/active_record/adapters/sqlite_adapter.rb
162
+ - lib/database_flusher/active_record/deletion_strategy.rb
163
+ - lib/database_flusher/active_record/transaction_strategy.rb
164
+ - lib/database_flusher/cleaner.rb
165
+ - lib/database_flusher/mongoid/deletion_strategy.rb
166
+ - lib/database_flusher/null_strategy.rb
74
167
  - lib/database_flusher/version.rb
75
168
  homepage: https://github.com/ebeigarts/database_flusher
76
169
  licenses:
@@ -84,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
84
177
  requirements:
85
178
  - - ">="
86
179
  - !ruby/object:Gem::Version
87
- version: '0'
180
+ version: 2.2.1
88
181
  required_rubygems_version: !ruby/object:Gem::Requirement
89
182
  requirements:
90
183
  - - ">="