fingerprint 3.2.0 → 3.3.0

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: 29779cfa264198432f16e421ed412e812a464332c4499d65e6a8039d0c08522f
4
- data.tar.gz: 97dc135381bfa725ab41d34fbaf58ff56a16c89bb2bb8749b1539c90abe30cd1
3
+ metadata.gz: c8ad0fb2f50f482dc7dc06185001d5eefd60ea136069d0e0c2004eaefdba4351
4
+ data.tar.gz: a0256e102d7628d5410fa94bb9f23b8f0858155a10d4dbef108097b76129ec78
5
5
  SHA512:
6
- metadata.gz: a8f9fdb7259e57057bc10f9e412b0444393ab2bcd90d11b7091fffa40800759f2a52f7fcc25a2f8edafe8cebbc199ae6a81eb95401e2e2204f2bb28d1ab611d0
7
- data.tar.gz: 418347660a6002e3e1cc5092a0e50c6d4462a034a6ccb1afe5e74f2912d2bb1d9dc3eda892fe4342a2db151d2952410461cbdde5f954fa6e881dc59e2df6d251
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, @options[:output])
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]
@@ -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
- # What should we do if we get multiple configurations?
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
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Fingerprint
22
- VERSION = "3.2.0"
22
+ VERSION = "3.3.0"
23
23
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fingerprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file