class HTMLProofer::CLI

The CLI is a class responsible of handling all the command line interface logic.

Attributes

options[R]

Public Class Methods

new() click to toggle source
# File lib/html_proofer/cli.rb, line 9
def initialize
  @options = {}
end

Public Instance Methods

run(args = ARGV) click to toggle source
# File lib/html_proofer/cli.rb, line 13
def run(args = ARGV)
  @options, path = HTMLProofer::Configuration.new.parse_cli_options(args)

  paths = path.split(",")

  if @options[:as_links]
    links = path.split(",").map(&:strip)
    HTMLProofer.check_links(links, @options).run
  elsif File.directory?(paths.first)
    HTMLProofer.check_directories(paths, @options).run
  else
    HTMLProofer.check_file(path, @options).run
  end
end