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.



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

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

Instance Method Details

#runObject



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

def run()     
  configuration = InternalW3cValidationConfiguration.new
  @block.call(configuration)
  results = InternalW3cValidator.new.validate_pages(configuration.pages)
  results.each do | error |
    puts error.to_s   
  end
  throw "There are #{results.length} W3c Validation Errors" if results.length > 0 && configuration.failOnError
end