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/middleware.rb,
lib/html-proofer/configuration.rb,
lib/html-proofer/url_validator.rb

Defined Under Namespace

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

Constant Summary collapse

VERSION =
'3.12.0'.freeze

Class Method Summary collapse

Class Method Details

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

Raises:

  • (ArgumentError)

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

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)

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

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)

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

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)

48
49
50
51
52
# File 'lib/html-proofer.rb', line 48

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