Sha256: faeadf9df7559a4deb25f19d534e8665d25518322de270475d10fe686d4fede6

Contents?: true

Size: 673 Bytes

Versions: 3

Compression:

Stored size: 673 Bytes

Contents

require 'optparse'

def expand_dirs_to_files *dirs
  extensions = ['rb', 'builder']

  dirs.flatten.map { |p|
    if File.directory? p
      Dir[File.join(p, '**', "*{#{extensions.join(',')}}")]
    else
      p
    end
  }.flatten.sort
end

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: rails_best_practices [options]"
  
  opts.on_tail("-h", "--help", "Show this message") do
    puts opts
    exit
  end

  opts.parse!
end

runner = RailsBestPractices::Core::Runner.new
expand_dirs_to_files(ARGV).each.each { |file| runner.check_file(file) }
runner.errors.each {|error| puts error}
puts "\nFound #{runner.errors.size} errors."

exit runner.errors.size

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_best_practices-0.2.4 lib/rails_best_practices/command.rb
rails_best_practices-0.2.3 lib/rails_best_practices/command.rb
rails_best_practices-0.2.2 lib/rails_best_practices/command.rb