Class: InternalW3cValidatorWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/InternalW3cValidation.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ InternalW3cValidatorWrapper

Returns a new instance of InternalW3cValidatorWrapper.



12
13
14
# File 'lib/InternalW3cValidation.rb', line 12

def initialize(&block)
  @block = block;
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/InternalW3cValidation.rb', line 16

def run()     
  configuration = InternalW3cValidationConfiguration.new
  @block.call(configuration)
  errorReporter = ErrorReporterFactory.create(configuration)
  results = InternalW3cValidator.new.validate_pages(configuration.pages)
  results.each do | error |
    errorReporter.show(error)   
  end
  errorReporter.end
  throw '' if results.length > 0 && configuration.failOnError
end