database_consistency 1.3.7 → 1.3.9

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
  SHA256:
3
- metadata.gz: 3977b5e14b960051dad79361a32e435e511707612a269512fd42dcbac389216f
4
- data.tar.gz: 95aba2661c7724aca4cee0e386b8f5e12e59f62b6444f35c66ebcabba2a6f9be
3
+ metadata.gz: c589e055624919d847ef24864b767c55ebb9bb37d18da70b0558e73c2336815c
4
+ data.tar.gz: 53bd691bf67c2a014d8c96cfd1e93f59699ace4c6a1ba41befeca8557c05fda6
5
5
  SHA512:
6
- metadata.gz: d71ae7f118719222bfcdb11329d8f0be6ca5c62d8f54ca145cd08f26d982e7e7b0a1b848397b19aa4e4a4c35e88602be24fd384896ed58cf6221f83e7d87280c
7
- data.tar.gz: 0b1efa4b1c268d3959eae583bd4b2e3dc6da2585ac64a6ebf4b4a83ad73710f1a0c704ff1fdee4e13c01b5170c41bf593f31bd77a7f6bea9b6d417fe892208d6
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(filepaths = DEFAULT_PATH)
11
- @configuration = Array(filepaths).each_with_object({}) do |filepath, result|
12
- content =
13
- if filepath && File.exist?(filepath)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '1.3.7'
4
+ VERSION = '1.3.9'
5
5
  end
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.7
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-22 00:00:00.000000000 Z
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!