file-digests 0.0.4 → 0.0.5

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: e3c77b8e030df2ad0633b1a233986dce951a93f2653a4fb31c8a91881c83f3e1
4
- data.tar.gz: 2db1eb6db4cc08665a55ace46a737b524b6491ade9822eda4905a24aa9606680
3
+ metadata.gz: 98453b1e2021c894ee88baa635f1de17ce8d1c24c4a37118d8aef85558096b1f
4
+ data.tar.gz: e649bde9ecce6a23a2f6cb2900c871e963aa9c7d514d942ae52a7606936119b8
5
5
  SHA512:
6
- metadata.gz: 89b338536c8f6c026153e9eaa532d81530737484d6676e30fe0826b094c2c4ed3fdcbe176f373e43df7801ad13f5f528220a15ae9a5d7decedd91be4bc02415c
7
- data.tar.gz: 0fd05670f470308fbfb0b43416b3bebc4597c41950811193d1e571816d6a305a1e85ae562759990f5c39bbff3ded35c1b5ff81674cc312505e1718ba4ee6e788
6
+ metadata.gz: 15e3ab7abd55f21b9cdba92d2e4468e7f2ce908f18a2548a50bba7d19d192d2b1dbf0d6690b5e3a6d54c8a026ddef09dc67189777c3a4565bc467d83b7697db5
7
+ data.tar.gz: c6be8b9ec34c9117873441c90d3b3b1b24bb96a36fa5d59b94d0b3d6959ca11dee7bc32f99e4325f3534a551c8677d2b538e066ecbd3a76a10ad6dac6274ddb2
@@ -21,7 +21,7 @@ def measure_time
21
21
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
22
22
  yield
23
23
  elapsed = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - start).to_i
24
- puts "Elapsed time: #{elapsed / 3600}h #{(elapsed % 3600) / 60}m #{elapsed % 60}s" if VERBOSE
24
+ puts "Elapsed time: #{elapsed / 3600}h #{(elapsed % 3600) / 60}m #{elapsed % 60}s" unless QUIET
25
25
  end
26
26
 
27
27
  def patch_path_string path
@@ -66,7 +66,7 @@ class DigestDatabase
66
66
 
67
67
  if found['digest'] == digest
68
68
  COUNTS[:good] += 1
69
- puts "GOOD: #{file_path}" if VERBOSE
69
+ # puts "GOOD: #{file_path}" unless QUIET
70
70
  unless TEST_ONLY
71
71
  if found['mtime'] == mtime
72
72
  @touch_digest_check_time.execute found['id']
@@ -77,10 +77,10 @@ class DigestDatabase
77
77
  else
78
78
  if found['mtime'] == mtime # Digest is different and mtime is the same
79
79
  COUNTS[:likely_damaged] += 1
80
- puts "LIKELY DAMAGED: #{file_path}"
80
+ STDERR.puts "LIKELY DAMAGED: #{file_path}"
81
81
  else
82
82
  COUNTS[:updated] += 1
83
- puts "UPDATED: #{file_path}" if VERBOSE || TEST_ONLY
83
+ puts "UPDATED: #{file_path}" unless QUIET
84
84
  unless TEST_ONLY
85
85
  @update_mtime_and_digest.execute mtime, digest, found['id']
86
86
  end
@@ -88,7 +88,7 @@ class DigestDatabase
88
88
  end
89
89
  else
90
90
  COUNTS[:new] += 1
91
- puts "NEW: #{file_path}" if VERBOSE || TEST_ONLY
91
+ puts "NEW: #{file_path}" unless QUIET
92
92
  unless TEST_ONLY
93
93
  @new_files[file_path] = digest
94
94
  @insert.execute! file_path, mtime, digest
@@ -182,7 +182,7 @@ class Checker
182
182
 
183
183
  end
184
184
 
185
- VERBOSE = (ENV["VERBOSE"] == "true")
185
+ QUIET = (ENV["QUIET"] == "true")
186
186
  TEST_ONLY = (ENV["TEST_ONLY"] == "true")
187
187
 
188
188
  COUNTS = {good: 0, updated: 0, new: 0, missing: 0, renamed: 0, likely_damaged: 0, exceptions: 0}
@@ -202,7 +202,7 @@ begin
202
202
  end
203
203
 
204
204
  if COUNTS[:likely_damaged] > 0 || COUNTS[:exceptions] > 0
205
- puts "ERRORS WERE OCCURRED, PLEASE CHECK FOR THEM"
205
+ STDERR.puts "ERRORS WERE OCCURRED"
206
206
  end
207
207
 
208
208
  puts COUNTS.inspect
@@ -21,7 +21,7 @@ def measure_time
21
21
  start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
22
22
  yield
23
23
  elapsed = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - start).to_i
24
- puts "Elapsed time: #{elapsed / 3600}h #{(elapsed % 3600) / 60}m #{elapsed % 60}s" if VERBOSE
24
+ puts "Elapsed time: #{elapsed / 3600}h #{(elapsed % 3600) / 60}m #{elapsed % 60}s" unless QUIET
25
25
  end
26
26
 
27
27
  def patch_path_string path
@@ -66,7 +66,7 @@ class DigestDatabase
66
66
 
67
67
  if found['digest'] == digest
68
68
  COUNTS[:good] += 1
69
- puts "GOOD: #{file_path}" if VERBOSE
69
+ # puts "GOOD: #{file_path}" unless QUIET
70
70
  unless TEST_ONLY
71
71
  if found['mtime'] == mtime
72
72
  @touch_digest_check_time.execute found['id']
@@ -77,10 +77,10 @@ class DigestDatabase
77
77
  else
78
78
  if found['mtime'] == mtime # Digest is different and mtime is the same
79
79
  COUNTS[:likely_damaged] += 1
80
- puts "LIKELY DAMAGED: #{file_path}"
80
+ STDERR.puts "LIKELY DAMAGED: #{file_path}"
81
81
  else
82
82
  COUNTS[:updated] += 1
83
- puts "UPDATED: #{file_path}" if VERBOSE || TEST_ONLY
83
+ puts "UPDATED: #{file_path}" unless QUIET
84
84
  unless TEST_ONLY
85
85
  @update_mtime_and_digest.execute mtime, digest, found['id']
86
86
  end
@@ -88,7 +88,7 @@ class DigestDatabase
88
88
  end
89
89
  else
90
90
  COUNTS[:new] += 1
91
- puts "NEW: #{file_path}" if VERBOSE || TEST_ONLY
91
+ puts "NEW: #{file_path}" unless QUIET
92
92
  unless TEST_ONLY
93
93
  @new_files[file_path] = digest
94
94
  @insert.execute! file_path, mtime, digest
@@ -182,7 +182,7 @@ class Checker
182
182
 
183
183
  end
184
184
 
185
- VERBOSE = (ENV["VERBOSE"] == "true")
185
+ QUIET = (ENV["QUIET"] == "true")
186
186
  TEST_ONLY = true
187
187
 
188
188
  COUNTS = {good: 0, updated: 0, new: 0, missing: 0, renamed: 0, likely_damaged: 0, exceptions: 0}
@@ -202,7 +202,7 @@ begin
202
202
  end
203
203
 
204
204
  if COUNTS[:likely_damaged] > 0 || COUNTS[:exceptions] > 0
205
- puts "ERRORS WERE OCCURRED, PLEASE CHECK FOR THEM"
205
+ STDERR.puts "ERRORS WERE OCCURRED"
206
206
  end
207
207
 
208
208
  puts COUNTS.inspect
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file-digests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav Senotrusov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-10-08 00:00:00.000000000 Z
@@ -38,7 +38,7 @@ homepage: https://github.com/senotrusov/file-digests
38
38
  licenses:
39
39
  - Apache-2.0
40
40
  metadata: {}
41
- post_install_message:
41
+ post_install_message:
42
42
  rdoc_options: []
43
43
  require_paths:
44
44
  - lib
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  requirements: []
56
56
  rubygems_version: 3.1.2
57
- signing_key:
57
+ signing_key:
58
58
  specification_version: 4
59
59
  summary: file-digests
60
60
  test_files: []