Method: HTMLProofer::Runner#run

Defined in:
lib/html_proofer/runner.rb

#runObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/html_proofer/runner.rb', line 38

def run
  check_text = pluralize(checks.length, "check", "checks")

  if @type == :links
    @logger.log(:info, "Running #{check_text} (#{format_checks_list(checks)}) on #{@source} ...\n\n")
    check_list_of_links unless @options[:disable_external]
  else
    @logger.log(
      :info,
      "Running #{check_text} (#{format_checks_list(checks)}) in #{@source} on *#{@options[:extensions].join(", ")} files ...\n\n",
    )

    check_files
    @logger.log(:info, "Ran on #{pluralize(files.length, "file", "files")}!\n\n")
  end

  @cache.write

  @reporter.failures = @failures

  if @failures.empty?
    @logger.log(:info, "HTML-Proofer finished successfully.")
  else
    @failures.uniq!
    report_failed_checks
  end
end