Sha256: 6ed6cdc1032146a58132a2f7010fbefea5be089a719233614a01330b504520ae

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

#!/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.empty?
  puts "\n  You must specify one or more directories to analyse, e.g.:\n"
  puts "\n    excellent app/\n\n"
  exit 1
end

ARGV.each do |arg|
  if File.file?(arg)
    excellent.check_file(arg)
  elsif File.directory?(arg)
    Dir.glob("#{arg}/**/*.rb").each { |file| excellent.check_file(file) }
  else
    puts "\n** Excellent cannot find '#{arg}'\n\n"
    exit 1
  end
end

unless excellent.warnings.empty?
  puts "\n  Warnings:\n\n"
  excellent.warnings.each do |warning|
    puts "  * File #{warning.filename}, line #{warning.line_number}: #{warning.message}"
  end
end
puts "\n  Found #{excellent.warnings.size} warnings.\n\n"

exit 0

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simplabs-excellent-1.2.1 bin/excellent
simplabs-excellent-1.2.2 bin/excellent