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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b117faf2434c91f017d6c1fd66af9b60dd39a320eb483d8c55dafa4870a79458
|
4
|
+
data.tar.gz: 4a9adb41296cad3b8c091b0bd62a4c5affa320e26c69fe8c68affc20cc7ea44e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bddbe6952f4e66a77108d01e016f452e016bbb43dceafc6e8c666e92426c06e3d7d8f65a0bfa8d4253e3eacb81f9eee71364e5a5fe1c82941d6dd9ab90d70243
|
7
|
+
data.tar.gz: 4466ef032c16a72a174ffd030347ed96a914bbc3cf844d930b22afadb938782da8074fe142f6fca36933c2a2e241ddb57041f33ebef19b45e7b1b5f0edeeacf3
|
@@ -12,11 +12,20 @@ module DatabaseConsistency
|
|
12
12
|
assign_result(hash, result)
|
13
13
|
end
|
14
14
|
|
15
|
-
|
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
|