Sha256: 438da8224e1e96d5c9f956322eca97f563a99bea5b4ce3f22d5f23b756529c23

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 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_FINGERPRINTS_FILE"
  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.count != 1
  puts option_parser
  exit
end

ndb = Recog::DB.new(ARGV.shift)
options.fingerprints = ndb.fingerprints
verifier = Recog::VerifierFactory.build(options)
verifier.verify_tests

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
recog-0.02 bin/recog_verify.rb
recog-0.01 bin/recog_verify.rb