file-digests 0.0.27 → 0.0.28
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 +4 -4
- data/lib/file-digests.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 406b02c22923ae98c45dc92f2836a99dffa6dc8b2343ff62b5b5957a4a154bdc
|
4
|
+
data.tar.gz: 5898cbc3826818da8c3fa5cf16a334bcb4627f95dc2635a297cc9c7d81d25dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '021494ba0a65daada30e55c63e489c60c018ae3b189409be200635948132f0ed5118d217388e81d8097bc991cf10fea2ce09c4a3a7c148c1fdaa8f66e6b8e074'
|
7
|
+
data.tar.gz: 3a28808aa979157a2597b5ea56ad006576d28f35678cbaa6e13d62be20aa37066a9d4684d48f5ed2990b24c42acb2ee8cd2d0f14f4f9b12f893c5b3946d5b76e
|
data/lib/file-digests.rb
CHANGED
@@ -101,16 +101,19 @@ class FileDigests
|
|
101
101
|
initialize_database
|
102
102
|
|
103
103
|
@db.transaction(:exclusive) do
|
104
|
-
if
|
105
|
-
if @
|
106
|
-
@
|
104
|
+
if db_digest_algorithm = get_metadata("digest_algorithm")
|
105
|
+
if @digest_algorithm = canonical_digest_algorithm_name(db_digest_algorithm)
|
106
|
+
if @options[:digest_algorithm] && @options[:digest_algorithm] != @digest_algorithm
|
107
|
+
@new_digest_algorithm = @options[:digest_algorithm]
|
108
|
+
end
|
109
|
+
else
|
110
|
+
raise "Database contains data for unsupported digest algorithm: #{db_digest_algorithm}"
|
107
111
|
end
|
108
112
|
else
|
109
113
|
@digest_algorithm = (@options[:digest_algorithm] || "BLAKE2b512")
|
110
114
|
set_metadata "digest_algorithm", @digest_algorithm
|
111
115
|
end
|
112
116
|
end
|
113
|
-
|
114
117
|
puts "Using #{@digest_algorithm} digest algorithm" if @options[:verbose]
|
115
118
|
end
|
116
119
|
|