Class: SiteHealth::HTMLProoferConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/site_health/configuration/html_proofer_configuration.rb

Overview

Holds HTMLProofer configuration data

Constant Summary collapse

LOG_LEVELS =

Valid log levels

%i[
  debug
  info
  warn
  error
  fatal
].freeze
ERROR_SORTS =

Valid error sorts

%i[path desc status].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHTMLProoferConfiguration

Returns a new instance of HTMLProoferConfiguration.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 32

def initialize
  @log_level = :fatal
  @check_opengraph = true
  @check_html = true
  @check_external_hash = true
  @check_img_http = false
  @empty_alt_ignore = false
  @error_sort = :path
  @enforce_https = false
  @assume_extension = true
  @report_missing_names = true
  @report_invalid_tags = true
  @check_favicon = true
  @ignore_missing_internal_links = true
end

Instance Attribute Details

#assume_extensionObject

Returns the value of attribute assume_extension.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def assume_extension
  @assume_extension
end

#check_external_hashObject

Returns the value of attribute check_external_hash.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def check_external_hash
  @check_external_hash
end

#check_faviconObject

Returns the value of attribute check_favicon.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def check_favicon
  @check_favicon
end

#check_htmlObject

Returns the value of attribute check_html.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def check_html
  @check_html
end

#check_img_httpObject

Returns the value of attribute check_img_http.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def check_img_http
  @check_img_http
end

#check_opengraphObject

Returns the value of attribute check_opengraph.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def check_opengraph
  @check_opengraph
end

#empty_alt_ignoreObject

Returns the value of attribute empty_alt_ignore.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def empty_alt_ignore
  @empty_alt_ignore
end

#enforce_httpsObject

Returns the value of attribute enforce_https.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def enforce_https
  @enforce_https
end

#error_sortObject

Returns the value of attribute error_sort.



6
7
8
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 6

def error_sort
  @error_sort
end

Returns the value of attribute ignore_missing_internal_links.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def ignore_missing_internal_links
  @ignore_missing_internal_links
end

#log_levelObject

Returns the value of attribute log_level.



6
7
8
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 6

def log_level
  @log_level
end

#report_invalid_tagsObject

Returns the value of attribute report_invalid_tags.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def report_invalid_tags
  @report_invalid_tags
end

#report_missing_namesObject

Returns the value of attribute report_missing_names.



8
9
10
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 8

def report_missing_names
  @report_missing_names
end

Instance Method Details

#to_hHash

Returns config as hash, only contains keys for ::HTMLProofer config.

Returns:

  • (Hash)

    config as hash, only contains keys for ::HTMLProofer config



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/site_health/configuration/html_proofer_configuration.rb', line 71

def to_h
  {
    log_level: log_level,
    check_opengraph: check_opengraph,
    check_html: check_html,
    check_external_hash: check_external_hash,
    empty_alt_ignore: empty_alt_ignore,
    check_img_http: check_img_http,
    error_sort: error_sort,
    enforce_https: enforce_https,
    assume_extension: assume_extension,
    report_missing_names: report_missing_names,
    report_invalid_tags: report_invalid_tags,
    check_favicon: check_favicon,
  }
end