Sha256: c5d960126af44d970be36b67db0adb6f1867c64520c7ff37ee93a7549c5e0404
Contents?: true
Size: 898 Bytes
Versions: 3
Compression:
Stored size: 898 Bytes
Contents
module Phare class CheckSuite attr_reader :status DEFAULT_CHECKS = { rubocop: Check::Rubocop, scsslint: Check::ScssLint, jshint: Check::JSHint, jscs: Check::JSCS } def initialize(options = {}) @options = options @directory = options[:directory] @directory << '/' unless @directory.end_with?('/') @options[:skip] ||= [] @options[:only] ||= [] end def checks checks = DEFAULT_CHECKS.keys if @options[:only].any? checks = checks & @options[:only] elsif @options[:skip] checks = checks - @options[:skip] else checks end end def run @checks = checks.map do |check| check = DEFAULT_CHECKS[check] check.new(@directory, @options).tap(&:run).status end @status = @checks.find { |status| status > 0 } || 0 end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
phare-0.5.2 | lib/phare/check_suite.rb |
phare-0.5.1 | lib/phare/check_suite.rb |
phare-0.5 | lib/phare/check_suite.rb |