Class: Nanoc::Checking::Runner Private
- Inherits:
-
Object
- Object
- Nanoc::Checking::Runner
- 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.
Constant Summary collapse
- NUM_THREADS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Number of threads to use for running checks.
5
Instance Method Summary collapse
- #any_enabled_checks? ⇒ Boolean private
-
#initialize(site) ⇒ Runner
constructor
private
A new instance of Runner.
-
#list_checks ⇒ void
private
Lists all available checks on stdout.
-
#run_all ⇒ Boolean
private
Runs all checks.
-
#run_for_deploy ⇒ Boolean
private
Runs the checks marked for deployment.
-
#run_specific(check_class_names) ⇒ Boolean
private
Runs the checks with the given names.
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.
13 14 15 16 17 |
# File 'lib/nanoc/checking/runner.rb', line 13 def initialize(site) @site = site @log_mutex = Thread::Mutex.new 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.
19 20 21 |
# File 'lib/nanoc/checking/runner.rb', line 19 def any_enabled_checks? !enabled_checks.empty? end |
#list_checks ⇒ void
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.
26 27 28 29 30 31 32 |
# File 'lib/nanoc/checking/runner.rb', line 26 def list_checks load_all puts 'Available checks:' puts puts all_check_classes.map { |i| ' ' + i.identifier.to_s }.sort.join("\n") end |
#run_all ⇒ 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 all checks.
37 38 39 40 |
# File 'lib/nanoc/checking/runner.rb', line 37 def run_all load_all run_check_classes(all_check_classes) end |
#run_for_deploy ⇒ 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 marked for deployment.
45 46 47 48 49 |
# File 'lib/nanoc/checking/runner.rb', line 45 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.
56 57 58 59 |
# File 'lib/nanoc/checking/runner.rb', line 56 def run_specific(check_class_names) load_all run_check_classes(check_classes_named(check_class_names)) end |