file-digests 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/file-digests.rb +7 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bae6b10fe6496192c178f9139003b8d5a19774c70d957fd83f83ee91540cff9
4
- data.tar.gz: 15d2965cb47eaeedec5dd56a0fe0a30e2f686e72d80f823416a351326d034ba8
3
+ metadata.gz: 912b66387453e26ebd7280d7f2dbd599838098a6bcc4da70d1eabe19737ba172
4
+ data.tar.gz: 9c02352223aff8d6489892df533606bd512de3357dfb59a82513dc04aa1eddfe
5
5
  SHA512:
6
- metadata.gz: 89b7fc7eea7a5b87f2cc23ea794ac1b2f85e9b367825694876afd91c9206c438a8df91487aaa4872e7b24480e0e5eb25b2750237318fc63305c605aa7fa372a4
7
- data.tar.gz: 8fedea5e7034824276ea1f315543d5248e09a06e2fb97cf714f242181012701209383ab6416fcc0bfa206ce5b278abcdef216e4d3e41bbb9463a265b537091f2
6
+ metadata.gz: '0380c5acf3750632a3fe49f63d93dbc7533da1389f3e8cab41addc8909f71552a280aec7e3e783e9ae20071bc94af3d70021098b1fbfba96a3e1f78967479c34'
7
+ data.tar.gz: 4b0a05a27dcb61ee405dc06688753d5eb162e3fdf513fa45aee9a1e2d946fd4697b4f2dbb45f1af57f33ee787c366665144a999c161976cd81992902bfe90fb5
@@ -41,6 +41,10 @@ class FileDigests
41
41
  options[:auto] = true
42
42
  end
43
43
 
44
+ opts.on("--accept-fate", "Accept the current state of files that are likely damaged and update their digest data") do
45
+ options[:accept_fate] = true
46
+ end
47
+
44
48
  opts.on(
45
49
  '--digest=DIGEST',
46
50
  'Select a digest algorithm to use. Default is "BLAKE2b512".',
@@ -193,7 +197,7 @@ class FileDigests
193
197
  end
194
198
 
195
199
  if get_metadata("database_version") != "2"
196
- STDERR.puts "This version of file-digests is only compartible with the database version 2. Current database version is #{get_metadata("database_version")}. To use this database, please install appropriate version if file-digest."
200
+ STDERR.puts "This version of file-digests (#{file_digests_gem_version || 'unknown'}) is only compartible with the database version 2. Current database version is #{get_metadata("database_version")}. To use this database, please install appropriate version if file-digest."
197
201
  raise "Incompatible database version"
198
202
  end
199
203
  end
@@ -234,6 +238,7 @@ class FileDigests
234
238
  update_digest_to_new_digest new_digest, old_digest
235
239
  end
236
240
  set_metadata "digest_algorithm", @new_digest_algorithm
241
+ puts "Transition to a new digest algorithm complete: #{@new_digest_algorithm}"
237
242
  end
238
243
  end
239
244
 
@@ -312,7 +317,7 @@ class FileDigests
312
317
  end
313
318
  end
314
319
  else
315
- if found['mtime'] == mtime # Digest is different and mtime is the same
320
+ if found['mtime'] == mtime && !@options[:accept_fate] # Digest is different and mtime is the same
316
321
  @counters[:likely_damaged] += 1
317
322
  STDERR.puts "LIKELY DAMAGED: #{filename}"
318
323
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file-digests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav Senotrusov