Sha256: cc52b364f022503fcc8b974392fe4f8c6efd3f154986a81ad2db969658d90ba7

Contents?: true

Size: 1.22 KB

Versions: 40

Compression:

Stored size: 1.22 KB

Contents

#!/usr/bin/env ruby

$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
require 'optparse'
require 'ostruct'
require 'recog'
require 'recog/verifier_factory'

options = OpenStruct.new(color: false, detail: false)

option_parser = OptionParser.new do |opts|
  opts.banner = "Usage: #{$0} [options] XML_FINGERPRINT_FILE1 ..."
  opts.separator "Verifies that each fingerprint passes its internal tests."
  opts.separator ""
  opts.separator "Options"

  opts.on("-f", "--format FORMATTER",
          "Choose a formatter.",
          "  [s]ummary (default - failure/warning msgs and summary)",
          "  [d]etail  (fingerprint name with tests and expanded summary)") do |format|
    if format.start_with? 'd'
      options.detail = true
    end
  end

  opts.on("-c", "--color", "Enable color in the output.") do
    options.color = true
  end

  opts.on("-h", "--help", "Show this message.") do
    puts opts
    exit
  end
end
option_parser.parse!(ARGV)

if ARGV.empty?
  $stderr.puts 'Missing XML fingerprint files'
  puts option_parser
  exit(1)
end

ARGV.each do |file|
  ndb = Recog::DB.new(file)
  options.fingerprints = ndb.fingerprints
  verifier = Recog::VerifierFactory.build(options)
  verifier.verify_tests
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
recog-1.0.23 bin/recog_verify
recog-1.0.22 bin/recog_verify
recog-1.0.21 bin/recog_verify
recog-1.0.20 bin/recog_verify
recog-1.0.19 bin/recog_verify
recog-1.0.18 bin/recog_verify
recog-1.0.17 bin/recog_verify
recog-1.0.16 bin/recog_verify
recog-1.0.15 bin/recog_verify.rb
recog-1.0.14 bin/recog_verify.rb
recog-1.0.13 bin/recog_verify.rb
recog-1.0.12 bin/recog_verify.rb
recog-1.0.11 bin/recog_verify.rb
recog-1.0.10 bin/recog_verify.rb
recog-1.0.9 bin/recog_verify.rb
recog-1.0.8 bin/recog_verify.rb
recog-1.0.7 bin/recog_verify.rb
recog-1.0.6 bin/recog_verify.rb
recog-1.0.5 bin/recog_verify.rb
recog-1.0.4 bin/recog_verify.rb