database_consistency 1.7.7 → 1.7.8

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: f17a39d98d4045434101b952706e15a54da6c1bc8a46860e7daa56932b9569a8
4
- data.tar.gz: 73a0950925d6158c7e9be1dfa7e9d2c706bed88590884c7ab9784e3434e044e0
3
+ metadata.gz: b117faf2434c91f017d6c1fd66af9b60dd39a320eb483d8c55dafa4870a79458
4
+ data.tar.gz: 4a9adb41296cad3b8c091b0bd62a4c5affa320e26c69fe8c68affc20cc7ea44e
5
5
  SHA512:
6
- metadata.gz: cd3677888dabe3342854f3ad10e2591cfb79027fd6f210099c4be014f21e02b3317dec9070a35b41876088fbae5bcd5d4faacdb452bbd6e98cfaf7808f3f3294
7
- data.tar.gz: a1bdfe2c29b6a873bec6f9866eb11b9a2ac90fe4117df6586f9e3ab3687cb20f29f387b23a34b011f5f2c6a52e52ee881b8b3682ee2e527c1673e2249a4f74fa
6
+ metadata.gz: bddbe6952f4e66a77108d01e016f452e016bbb43dceafc6e8c666e92426c06e3d7d8f65a0bfa8d4253e3eacb81f9eee71364e5a5fe1c82941d6dd9ab90d70243
7
+ data.tar.gz: 4466ef032c16a72a174ffd030347ed96a914bbc3cf844d930b22afadb938782da8074fe142f6fca36933c2a2e241ddb57041f33ebef19b45e7b1b5f0edeeacf3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '1.7.7'
4
+ VERSION = '1.7.8'
5
5
  end
@@ -12,11 +12,20 @@ module DatabaseConsistency
12
12
  assign_result(hash, result)
13
13
  end
14
14
 
15
- File.write(file_name, h.to_yaml)
15
+ sorted_hash = sort(h)
16
+
17
+ File.write(file_name, sorted_hash.to_yaml)
16
18
  end
17
19
 
18
20
  private
19
21
 
22
+ def sort(obj)
23
+ return obj unless obj.is_a?(Hash)
24
+
25
+ obj.sort_by { |(k, _)| k }
26
+ .to_h { |k, v| [k, sort(v)] }
27
+ end
28
+
20
29
  def write?(status)
21
30
  status == :fail
22
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_consistency
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.7
4
+ version: 1.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin