database_consistency 1.1.9 → 1.1.10

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: 32663c35384c7ebc62f0c15f382eb130392e0d58b57b32627f348a42f0f52d42
4
- data.tar.gz: dc8ef9b74fe351b3186a9ea8a4d68cd7049626d06f00a5cc072825f6dbef03a0
3
+ metadata.gz: 1b191ca6be5af749e9c3e7bd634696e5ecc648972f5b882954990bcc9e13dde2
4
+ data.tar.gz: 460e7edbac351faf21032e9d71c768d0e98b12ddafad792516bc5f4158122525
5
5
  SHA512:
6
- metadata.gz: '082d4d5c3a24d3af7d561c6f58fd7a0c3b4156aa59abe100620d4a8d559759ea306e90f10044dcfcf13457935ce81558141f12a9d0e9899b96b3b56332ac0831'
7
- data.tar.gz: 82005f6670dd8a92c88002842be6e38874ce5b1373369168e64bef961ad7444ee1098392fc93a5638f05e90d8b34e2a99db2f855990044c0a178a329a35fb631
6
+ metadata.gz: 4b1da4a7207245abc904aa28fcbbf2d8fe7c15683f86ad55557ba10b6d7699103404c42ed33a6fda82a413e4a6ed73681579dfd9512c7480d60a5f3da7d9d335
7
+ data.tar.gz: a4a13d8527677783f144448bfbe892d282086fffbe6dd04121aa50052d435c2d370eee32ee7c378047a2cf47817fcee4b74b9e7d0f9ed4b652d80431948196cc
@@ -11,7 +11,7 @@ module DatabaseConsistency
11
11
  @configuration = Array(filepaths).each_with_object({}) do |filepath, result|
12
12
  content =
13
13
  if filepath && File.exist?(filepath)
14
- data = YAML.load_file(filepath)
14
+ data = load_yaml_config_file(filepath)
15
15
  data.is_a?(Hash) ? data : {}
16
16
  else
17
17
  {}
@@ -53,6 +53,14 @@ module DatabaseConsistency
53
53
 
54
54
  attr_reader :configuration
55
55
 
56
+ def load_yaml_config_file(filepath)
57
+ if YAML.respond_to?(:safe_load_file)
58
+ YAML.safe_load_file(filepath, aliases: true)
59
+ else
60
+ YAML.load_file(filepath)
61
+ end
62
+ end
63
+
56
64
  def combine_configs!(config, new_config)
57
65
  config.merge!(new_config) do |_key, val, new_val|
58
66
  if val.is_a?(Hash) && new_val.is_a?(Hash)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '1.1.9'
4
+ VERSION = '1.1.10'
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.1.9
4
+ version: 1.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-29 00:00:00.000000000 Z
11
+ date: 2022-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord