Class: Fingerprint::Command::Verify
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Fingerprint::Command::Verify
- Defined in:
- lib/fingerprint/command/verify.rb
Instance Attribute Summary collapse
-
#error_count ⇒ Object
readonly
Returns the value of attribute error_count.
Instance Method Summary collapse
Instance Attribute Details
#error_count ⇒ Object (readonly)
Returns the value of attribute error_count.
51 52 53 |
# File 'lib/fingerprint/command/verify.rb', line 51 def error_count @error_count end |
Instance Method Details
#call ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/fingerprint/command/verify.rb', line 53 def call input_file = @options[:name] unless File.exist? input_file abort "Can't find index #{input_file}. Aborting." end = @options.dup [:output] = @parent.output master = RecordSet.new File.open(input_file, "r") do |io| master.parse(io) end if master.configuration .merge!(master.configuration.) end scanner = Scanner.new(@paths, ) # We use a sparse record set here, so we can't check for additions. copy = SparseRecordSet.new(scanner) @error_count = Checker.verify(master, copy, **) if @options[:fail_on_errors] abort "Data inconsistent, #{error_count} error(s) found!" if error_count != 0 end end |