Module: HTMLProofer

Defined in:
lib/html-proofer.rb,
lib/html-proofer/log.rb,
lib/html-proofer/cache.rb,
lib/html-proofer/check.rb,
lib/html-proofer/issue.rb,
lib/html-proofer/utils.rb,
lib/html-proofer/runner.rb,
lib/html-proofer/element.rb,
lib/html-proofer/version.rb,
lib/html-proofer/configuration.rb,
lib/html-proofer/url_validator.rb

Defined Under Namespace

Modules: Configuration, Utils Classes: Cache, Check, Element, Issue, Log, Runner, SortedIssues, UrlValidator

Constant Summary collapse

VERSION =
'3.10.2'.freeze

Class Method Summary collapse

Class Method Details

.check_directories(directories, options = {}) ⇒ Object

Raises:

  • (ArgumentError)

36
37
38
39
40
41
42
43
# File 'lib/html-proofer.rb', line 36

def check_directories(directories, options = {})
  raise ArgumentError unless directories.is_a?(Array)
  options[:type] = :directory
  directories.each do |directory|
    raise ArgumentError, "#{directory} does not exist" unless Dir.exist?(directory)
  end
  HTMLProofer::Runner.new(directories, options)
end

.check_directory(directory, options = {}) ⇒ Object

Raises:

  • (ArgumentError)

28
29
30
31
32
33
# File 'lib/html-proofer.rb', line 28

def check_directory(directory, options = {})
  raise ArgumentError unless directory.is_a?(String)
  raise ArgumentError, "#{directory} does not exist" unless Dir.exist?(directory)
  options[:type] = :directory
  HTMLProofer::Runner.new([directory], options)
end

.check_file(file, options = {}) ⇒ Object

Raises:

  • (ArgumentError)

20
21
22
23
24
25
# File 'lib/html-proofer.rb', line 20

def check_file(file, options = {})
  raise ArgumentError unless file.is_a?(String)
  raise ArgumentError, "#{file} does not exist" unless File.exist?(file)
  options[:type] = :file
  HTMLProofer::Runner.new(file, options)
end

Raises:

  • (ArgumentError)

46
47
48
49
50
# File 'lib/html-proofer.rb', line 46

def check_links(links, options = {})
  raise ArgumentError unless links.is_a?(Array)
  options[:type] = :links
  HTMLProofer::Runner.new(links, options)
end