Class: Nanoc::Checking::Runner Private

Inherits:
Object
  • Object
show all
Defined in:
lib/nanoc/checking/runner.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Runner is reponsible for running issue checks.

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ Runner

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Runner.

Parameters:

  • site (Nanoc::Core::Site)

    The Nanoc site this runner is for



10
11
12
# File 'lib/nanoc/checking/runner.rb', line 10

def initialize(site)
  @site = site
end

Instance Method Details

#any_enabled_checks?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


14
15
16
# File 'lib/nanoc/checking/runner.rb', line 14

def any_enabled_checks?
  enabled_checks.any?
end

#list_checksvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Lists all available checks on stdout.



21
22
23
24
25
26
27
# File 'lib/nanoc/checking/runner.rb', line 21

def list_checks
  load_all

  puts 'Available checks:'
  puts
  puts all_check_classes.map { |i| '  ' + i.identifier.to_s }.sort.join("\n")
end

#run_allBoolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs all checks.

Returns:

  • (Boolean)

    true if successful, false otherwise



32
33
34
35
# File 'lib/nanoc/checking/runner.rb', line 32

def run_all
  load_all
  run_check_classes(all_check_classes)
end

#run_for_deployBoolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs the checks marked for deployment.

Returns:

  • (Boolean)

    true if successful, false otherwise



40
41
42
43
44
# File 'lib/nanoc/checking/runner.rb', line 40

def run_for_deploy
  # TODO: rename to #run_enabled
  load_all
  run_check_classes(check_classes_named(enabled_checks))
end

#run_specific(check_class_names) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs the checks with the given names.

Parameters:

  • check_class_names (Array<Symbol>)

    The names of the checks

Returns:

  • (Boolean)

    true if successful, false otherwise



51
52
53
54
# File 'lib/nanoc/checking/runner.rb', line 51

def run_specific(check_class_names)
  load_all
  run_check_classes(check_classes_named(check_class_names))
end