database_consistency 1.7.9 → 1.7.11
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf8618ba8f3e8311f6cfe28281eb840f72fb389267d23c7df8dacceb81466856
|
4
|
+
data.tar.gz: 14b60dbacd605899a0f1e5c95147b1f879d36ff70bcf761f867412697093d552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 368509ce28357a3817a1f8c05233db99b9baa451b70e28fc484d2ea87e1745de08a65c0aff88dfc71d730b8fcd5932565b685b97d1a32b224faf9f494413055c
|
7
|
+
data.tar.gz: d8f1272dfabd6d7531efe1d37fd13924bedf734bf4def4274c24c8bc0d85e616a6b2c391e8594f32051e3a5cba15cb19d3aab2c6a8b682d48b1d928f21c95c00
|
@@ -33,7 +33,7 @@ module DatabaseConsistency
|
|
33
33
|
value = global_enabling
|
34
34
|
|
35
35
|
path.each do |key|
|
36
|
-
current =
|
36
|
+
current = find(key.to_s, current)
|
37
37
|
return value unless current.is_a?(Hash)
|
38
38
|
|
39
39
|
next if current['enabled'].nil?
|
@@ -48,6 +48,16 @@ module DatabaseConsistency
|
|
48
48
|
|
49
49
|
attr_reader :configuration
|
50
50
|
|
51
|
+
def find(key, configuration)
|
52
|
+
return configuration[key] if configuration.key?(key)
|
53
|
+
|
54
|
+
configuration.find { |(k, _)| k.include?('*') && key.match?(generate_regexp(k)) }&.last
|
55
|
+
end
|
56
|
+
|
57
|
+
def generate_regexp(str)
|
58
|
+
/\A#{str.gsub('*', '.*')}\z/
|
59
|
+
end
|
60
|
+
|
51
61
|
def existing_configurations(paths)
|
52
62
|
Array(paths).select do |filepath|
|
53
63
|
filepath && File.exist?(filepath)
|
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.7.
|
4
|
+
version: 1.7.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Demin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|