Sha256: dfd9fd8f2edc9cb57d02935ea39ccf81a36cf43ac50f56efbd90474584edaea8

Contents?: true

Size: 662 Bytes

Versions: 5

Compression:

Stored size: 662 Bytes

Contents

require 'optparse'

def expand_dirs_to_files *dirs
  extensions = ['rb']

  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

5 entries across 5 versions & 1 rubygems

Version Path
rails_best_practices-0.2.1 lib/rails_best_practices/command.rb
rails_best_practices-0.2.0 lib/rails_best_practices/command.rb
rails_best_practices-0.1.2 lib/rails_best_practices/command.rb
rails_best_practices-0.1.1 lib/rails_best_practices/command.rb
rails_best_practices-0.1.0 lib/rails_best_practices/command.rb