Module: TentValidator::Runner

Defined in:
lib/tent-validator/runner.rb,
lib/tent-validator/runner/cli.rb

Defined Under Namespace

Classes: CLI, Results

Class Method Summary collapse

Class Method Details

.run(&block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/tent-validator/runner.rb', line 25

def self.run(&block)
  paths = Dir[File.expand_path(File.join(File.dirname(__FILE__), 'validators', '**', '*_validator.rb'))]
  paths.each { |path| require path }

  results = Results.new

  TentValidator.validators.each do |validator|
    results.merge!(validator.run)
    block.call(results) if block
  end

  results
end