fingerprint 3.2.0 → 3.3.0
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
- checksums.yaml.gz.sig +0 -0
- data/lib/fingerprint/command/duplicates.rb +5 -3
- data/lib/fingerprint/record.rb +24 -7
- data/lib/fingerprint/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8ad0fb2f50f482dc7dc06185001d5eefd60ea136069d0e0c2004eaefdba4351
|
4
|
+
data.tar.gz: a0256e102d7628d5410fa94bb9f23b8f0858155a10d4dbef108097b76129ec78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0aff09d12a3c2f5c683433aa1e6ed0f9f2a8d77be668cdd1aac6d20899821d091f1edce2be721bc5889b12cfe69bfd1248fed6e275ab6a941c7da6b416d2457
|
7
|
+
data.tar.gz: 1ac6617e297ed4395fb05fd8cb6e785f98b9f298b0b1326235b034d450c78858cdbcab7370b781150c8acc06ff6cb7df444703632321374d426a02dfaf0f14c7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -42,10 +42,8 @@ module Fingerprint
|
|
42
42
|
attr :duplicates_recordset
|
43
43
|
|
44
44
|
def call
|
45
|
-
@options[:output] = @parent.output
|
46
|
-
|
47
45
|
@duplicates_recordset = RecordSet.new
|
48
|
-
results = RecordSetPrinter.new(duplicates_recordset, @
|
46
|
+
results = RecordSetPrinter.new(@duplicates_recordset, @parent.output)
|
49
47
|
|
50
48
|
master_file_path = @master
|
51
49
|
File.open(master_file_path) do |master_file|
|
@@ -67,7 +65,11 @@ module Fingerprint
|
|
67
65
|
copy_recordset.parse(copy_file)
|
68
66
|
|
69
67
|
copy_recordset.records.each do |record|
|
68
|
+
next unless record.file?
|
69
|
+
|
70
70
|
record.metadata['fingerprint'] = copy_file_path
|
71
|
+
record.metadata['full_path'] = copy_recordset.full_path(record.path)
|
72
|
+
|
71
73
|
# We need to see if the record exists in the master
|
72
74
|
|
73
75
|
if @options[:verbose]
|
data/lib/fingerprint/record.rb
CHANGED
@@ -46,6 +46,10 @@ module Fingerprint
|
|
46
46
|
attr :metadata
|
47
47
|
attr :keys
|
48
48
|
|
49
|
+
def file?
|
50
|
+
@mode == :file
|
51
|
+
end
|
52
|
+
|
49
53
|
def [](key)
|
50
54
|
@metadata[key]
|
51
55
|
end
|
@@ -95,29 +99,42 @@ module Fingerprint
|
|
95
99
|
self.new.tap{|record_set| record_set.parse(io)}
|
96
100
|
end
|
97
101
|
|
98
|
-
def initialize
|
102
|
+
def initialize(root = nil)
|
103
|
+
@root = root
|
99
104
|
@records = []
|
100
105
|
@paths = {}
|
101
106
|
@keys = {}
|
102
107
|
|
103
108
|
@configuration = nil
|
104
|
-
|
109
|
+
|
105
110
|
@callback = nil
|
106
111
|
end
|
107
|
-
|
112
|
+
|
113
|
+
attr :root
|
114
|
+
|
108
115
|
attr :records
|
109
116
|
attr :paths
|
110
117
|
attr :keys
|
111
|
-
|
118
|
+
|
112
119
|
attr :configuration
|
113
|
-
|
120
|
+
|
121
|
+
def full_path(path)
|
122
|
+
Build::Files::Path.join(@root, path)
|
123
|
+
end
|
124
|
+
|
114
125
|
def <<(record)
|
115
126
|
@records << record
|
127
|
+
|
116
128
|
if record.mode == :configuration
|
117
|
-
|
129
|
+
if @configuration
|
130
|
+
raise "Multiple configurations detected!"
|
131
|
+
end
|
132
|
+
|
118
133
|
@configuration = record
|
134
|
+
@root = @configuration.path
|
119
135
|
else
|
120
136
|
@paths[record.path] = record
|
137
|
+
|
121
138
|
record.keys.each do |key|
|
122
139
|
@keys[key] ||= {}
|
123
140
|
|
@@ -125,7 +142,7 @@ module Fingerprint
|
|
125
142
|
end
|
126
143
|
end
|
127
144
|
end
|
128
|
-
|
145
|
+
|
129
146
|
def include?(path)
|
130
147
|
@paths.include?(path)
|
131
148
|
end
|
data/lib/fingerprint/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|