database_consistency 1.3.7 → 1.3.9
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/lib/database_consistency/configuration.rb +19 -11
- data/lib/database_consistency/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c589e055624919d847ef24864b767c55ebb9bb37d18da70b0558e73c2336815c
|
4
|
+
data.tar.gz: 53bd691bf67c2a014d8c96cfd1e93f59699ace4c6a1ba41befeca8557c05fda6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f15b6e520813a6cc98105f250bdfa4397f12c1fff90357680681bafdba028a748bb74de0e43ac22fd377fcdf9569e619d0bd09e14095301c7ea353c45dc71146
|
7
|
+
data.tar.gz: 27e3773b5458c410b80c6640e5e1fc0e863faf568a7b26cf0bddbf8441411971e79ffe8ede2d77fae11c1cf590e7fe13439f0c32ee423305ad0d3d77c77b98f1
|
@@ -7,17 +7,10 @@ module DatabaseConsistency
|
|
7
7
|
class Configuration
|
8
8
|
DEFAULT_PATH = '.database_consistency.yml'
|
9
9
|
|
10
|
-
def initialize(
|
11
|
-
@configuration =
|
12
|
-
|
13
|
-
|
14
|
-
data = load_yaml_config_file(filepath)
|
15
|
-
data.is_a?(Hash) ? data : {}
|
16
|
-
else
|
17
|
-
{}
|
18
|
-
end
|
19
|
-
|
20
|
-
combine_configs!(result, content)
|
10
|
+
def initialize(file_paths = DEFAULT_PATH)
|
11
|
+
@configuration = existing_configurations(file_paths).then do |existing_paths|
|
12
|
+
puts "Loaded configurations: #{existing_paths.join(', ')}"
|
13
|
+
extract_configurations(existing_paths)
|
21
14
|
end
|
22
15
|
end
|
23
16
|
|
@@ -55,6 +48,21 @@ module DatabaseConsistency
|
|
55
48
|
|
56
49
|
attr_reader :configuration
|
57
50
|
|
51
|
+
def existing_configurations(paths)
|
52
|
+
Array(paths).select do |filepath|
|
53
|
+
filepath && File.exist?(filepath)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def extract_configurations(paths)
|
58
|
+
Array(paths).each_with_object({}) do |filepath, result|
|
59
|
+
data = load_yaml_config_file(filepath)
|
60
|
+
content = data.is_a?(Hash) ? data : {}
|
61
|
+
|
62
|
+
combine_configs!(result, content)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
58
66
|
def global_enabling
|
59
67
|
value = configuration.dig('DatabaseConsistencyCheckers', 'All', 'enabled')
|
60
68
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_consistency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Demin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -221,7 +221,8 @@ files:
|
|
221
221
|
homepage: https://github.com/djezzzl/database_consistency
|
222
222
|
licenses:
|
223
223
|
- MIT
|
224
|
-
metadata:
|
224
|
+
metadata:
|
225
|
+
funding_uri: https://opencollective.com/database_consistency#support
|
225
226
|
post_install_message: |2+
|
226
227
|
|
227
228
|
Thank you for using the gem!
|