Class: Nanoc::Extra::Validators::W3C Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/extra/validators/w3c.rb

Overview

Deprecated.

Use the Checking API or the check command instead

Instance Method Summary (collapse)

Constructor Details

- (W3C) initialize(dir, types)

Returns a new instance of W3C



6
7
8
9
# File 'lib/nanoc/extra/validators/w3c.rb', line 6

def initialize(dir, types)
  @dir   = dir
  @types = types
end

Instance Method Details

- (Object) run



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/nanoc/extra/validators/w3c.rb', line 11

def run
  args = []
  types = @types.dup
  args << 'html' if types.delete(:html)
  args << 'css'  if types.delete(:css)
  unless types.empty?
    raise Nanoc::Errors::GenericTrivial, "unknown type(s) specified: #{types.join(', ')}"
  end

  Nanoc::CLI.run(['check', args].flatten)
end