#!/usr/bin/env ruby $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib")) require 'simplabs/excellent' require 'pathname' excellent = Simplabs::Excellent::Runner.new if ARGV.first =~ /html:[^\s]+/ begin output = File.open(ARGV.first.sub(/html:/, ''), 'w+') formatter = Simplabs::Excellent::Formatters::Html.new(output) ARGV.shift rescue end else formatter = Simplabs::Excellent::Formatters::Text.new end if ARGV.empty? puts "\n You must specify one or more directories to analyse, e.g.:\n" puts "\n excellent app/\n\n" exit 1 end begin excellent.check_paths(ARGV, formatter) rescue ArgumentError => ex puts "EXCEPTION: #{ex.message}" puts "\n** Excellent cannot find the paths specified!\n\n" exit 1 end exit 0