combustion 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY +4 -0
- data/README.md +2 -2
- data/combustion.gemspec +1 -1
- data/lib/combustion/database/reset.rb +15 -1
- data/lib/combustion/databases/base.rb +1 -1
- data/lib/combustion/databases/firebird.rb +1 -1
- data/lib/combustion/databases/oracle.rb +1 -1
- data/spec/database_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f28e971887ec1b8cccd6708b6a5959fd16dc5afb5e3a1983f002385c3ecbf7a8
|
4
|
+
data.tar.gz: b7b4126b5923c1aa847fac7a4b8a2d43d0f8e06aed9fe21cfe62a11c9c5991ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff71dda123358ad658f97c536a7a9e1b8d16d2fc8d00518d126677bb408fb3947ec13e428fd335d3be77bad71a0d6f706dc9b0cc3f681e8b0375c29ff447027c
|
7
|
+
data.tar.gz: 66eaf6b8b3959dc114326a5b7fc73ead3b47a96a11a9bb21c528efcba59349a07eae6ed09430af2fa2f744e74100f99557cc8bf5f71b970fa144e504268c22bb
|
data/HISTORY
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
0.9.0 - March 26th 2018
|
2
|
+
* Only reset databases that are either custom or the current one (Moritz Winter).
|
3
|
+
* More consistency around environment handling (rather than presuming it's always the test environment).
|
4
|
+
|
1
5
|
0.8.0 - February 1st 2018
|
2
6
|
* Rails 5.2.0 support.
|
3
7
|
* Requiring digest from std-lib directly.
|
data/README.md
CHANGED
@@ -10,10 +10,10 @@ Get the gem into either your gemspec or your Gemfile, depending on how you manag
|
|
10
10
|
|
11
11
|
```ruby
|
12
12
|
# gemspec
|
13
|
-
gem.add_development_dependency 'combustion', '~> 0.
|
13
|
+
gem.add_development_dependency 'combustion', '~> 0.9.0'
|
14
14
|
|
15
15
|
# Gemfile
|
16
|
-
gem 'combustion', '~> 0.
|
16
|
+
gem 'combustion', '~> 0.9.0', :group => :test
|
17
17
|
```
|
18
18
|
|
19
19
|
In your `spec_helper.rb`, get Combustion to set itself up - which has to happen before you introduce `rspec/rails` and - if being used - `capybara/rails`. Here's an example within context:
|
data/combustion.gemspec
CHANGED
@@ -12,6 +12,8 @@ class Combustion::Database::Reset
|
|
12
12
|
Combustion::Databases::Firebird => %w[ firebird ]
|
13
13
|
}.freeze
|
14
14
|
|
15
|
+
RAILS_DEFAULT_ENVIRONMENTS = %w[ development production test ].freeze
|
16
|
+
|
15
17
|
def self.call
|
16
18
|
new.call
|
17
19
|
end
|
@@ -23,7 +25,7 @@ class Combustion::Database::Reset
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def call
|
26
|
-
|
28
|
+
resettable_db_configs.each_value do |configuration|
|
27
29
|
adapter = configuration["adapter"] ||
|
28
30
|
configuration["url"].split("://").first
|
29
31
|
|
@@ -46,4 +48,16 @@ class Combustion::Database::Reset
|
|
46
48
|
|
47
49
|
raise UnsupportedDatabase, "Unsupported database type: #{adapter}"
|
48
50
|
end
|
51
|
+
|
52
|
+
# All database configs except Rails default environments
|
53
|
+
# that are not currently in use
|
54
|
+
def resettable_db_configs
|
55
|
+
unused_environments = RAILS_DEFAULT_ENVIRONMENTS - [Rails.env.to_s]
|
56
|
+
resettable_environments = ActiveRecord::Base.configurations.keys -
|
57
|
+
unused_environments
|
58
|
+
|
59
|
+
ActiveRecord::Base.configurations.select do |name|
|
60
|
+
resettable_environments.include?(name)
|
61
|
+
end
|
62
|
+
end
|
49
63
|
end
|
data/spec/database_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: combustion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project: combustion
|
234
|
-
rubygems_version: 2.7.
|
234
|
+
rubygems_version: 2.7.6
|
235
235
|
signing_key:
|
236
236
|
specification_version: 4
|
237
237
|
summary: Elegant Rails Engine Testing
|