Class: Nanoc::Extra::Checking::Runner Private
- Inherits:
-
Object
- Object
- Nanoc::Extra::Checking::Runner
- Defined in:
- lib/nanoc/extra/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
- CHECKS_FILENAMES =
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.
['Checks', 'Checks.rb', 'checks', 'checks.rb']
Instance Method Summary (collapse)
-
- (Object) checks_filename
private
-
- (Boolean) has_dsl?
private
True if a Checks file exists, false otherwise.
-
- (Runner) initialize(site)
constructor
private
A new instance of Runner.
-
- (void) list_checks
private
Lists all available checks on stdout.
-
- (Boolean) run_all
private
Runs all checks.
-
- (Boolean) run_for_deploy
private
Runs the checks marked for deployment.
-
- (Boolean) run_specific(check_class_names)
private
Runs the checks with the given names.
Constructor Details
- (Runner) initialize(site)
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 |
# File 'lib/nanoc/extra/checking/runner.rb', line 13 def initialize(site) @site = site end |
Instance Method Details
- (Object) checks_filename
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.
18 19 20 |
# File 'lib/nanoc/extra/checking/runner.rb', line 18 def checks_filename @_checks_filename ||= CHECKS_FILENAMES.find { |f| File.file?(f) } end |
- (Boolean) has_dsl?
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 true if a Checks file exists, false otherwise
23 24 25 |
# File 'lib/nanoc/extra/checking/runner.rb', line 23 def has_dsl? checks_filename && File.file?(checks_filename) end |
- (void) list_checks
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.
30 31 32 33 34 35 36 |
# File 'lib/nanoc/extra/checking/runner.rb', line 30 def list_checks load_dsl_if_available puts 'Available checks:' puts puts all_check_classes.map { |i| ' ' + i.identifier.to_s }.sort.join("\n") end |
- (Boolean) run_all
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.
41 42 43 44 45 |
# File 'lib/nanoc/extra/checking/runner.rb', line 41 def run_all load_dsl_if_available run_check_classes(all_check_classes) end |
- (Boolean) run_for_deploy
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.
50 51 52 53 54 55 |
# File 'lib/nanoc/extra/checking/runner.rb', line 50 def run_for_deploy require_dsl return true if dsl.nil? run_check_classes(check_classes_named(dsl.deploy_checks)) end |
- (Boolean) run_specific(check_class_names)
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.
62 63 64 65 66 |
# File 'lib/nanoc/extra/checking/runner.rb', line 62 def run_specific(check_class_names) load_dsl_if_available run_check_classes(check_classes_named(check_class_names)) end |