file-digests 0.0.4 → 0.0.5
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/bin/file-digests +7 -7
- data/bin/file-digests-test +7 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98453b1e2021c894ee88baa635f1de17ce8d1c24c4a37118d8aef85558096b1f
|
4
|
+
data.tar.gz: e649bde9ecce6a23a2f6cb2900c871e963aa9c7d514d942ae52a7606936119b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15e3ab7abd55f21b9cdba92d2e4468e7f2ce908f18a2548a50bba7d19d192d2b1dbf0d6690b5e3a6d54c8a026ddef09dc67189777c3a4565bc467d83b7697db5
|
7
|
+
data.tar.gz: c6be8b9ec34c9117873441c90d3b3b1b24bb96a36fa5d59b94d0b3d6959ca11dee7bc32f99e4325f3534a551c8677d2b538e066ecbd3a76a10ad6dac6274ddb2
|
data/bin/file-digests
CHANGED
@@ -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"
|
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}"
|
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}"
|
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}"
|
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
|
-
|
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
|
205
|
+
STDERR.puts "ERRORS WERE OCCURRED"
|
206
206
|
end
|
207
207
|
|
208
208
|
puts COUNTS.inspect
|
data/bin/file-digests-test
CHANGED
@@ -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"
|
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}"
|
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}"
|
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}"
|
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
|
-
|
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
|
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
|
+
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: []
|