Class: BuildpackSupport::Rake::CheckAPIDocTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- BuildpackSupport::Rake::CheckAPIDocTask
- Defined in:
- lib/buildpack_support/rake/check_api_doc_task.rb
Overview
A task generator for the check_api_doc
task
Instance Attribute Summary collapse
-
#name ⇒ String
The name of the task.
-
#verbose ⇒ Boolean
The verbosity of the task.
Instance Method Summary collapse
-
#initialize(*args, &task_block) ⇒ CheckAPIDocTask
constructor
Creates a new instance of the
check_api_doc
task. -
#run_task(verbose) ⇒ void
Run the main task functionality.
Constructor Details
#initialize(*args, &task_block) ⇒ CheckAPIDocTask
Creates a new instance of the check_api_doc
task
35 36 37 38 39 40 41 42 43 |
# File 'lib/buildpack_support/rake/check_api_doc_task.rb', line 35 def initialize(*args, &task_block) setup_ivars args desc 'Check that all APIs have been documented' unless ::Rake.application.last_comment task(name, *args) do |_, task_args| task_block.call(*[self, task_args].slice(0, task_block.arity)) if task_block run_task verbose end end |
Instance Attribute Details
#name ⇒ String
Returns the name of the task. Defaults to :check_api_doc
.
28 29 30 |
# File 'lib/buildpack_support/rake/check_api_doc_task.rb', line 28 def name @name end |
#verbose ⇒ Boolean
Returns the verbosity of the task. Defaults to true
.
32 33 34 |
# File 'lib/buildpack_support/rake/check_api_doc_task.rb', line 32 def verbose @verbose end |
Instance Method Details
#run_task(verbose) ⇒ void
This method returns an undefined value.
Run the main task functionality
49 50 51 52 |
# File 'lib/buildpack_support/rake/check_api_doc_task.rb', line 49 def run_task(verbose) output = `yard stats --list-undoc` abort (output, verbose) if output !~ /100.00% documented/ end |