disu.se

YARDClass

Namespace

Inventory::Rake::Tasks

Ancestors
  1. Rake::DSL

  2. Object

Defines a task that invokes YARD to process embedded documentation.

Constructor

initialize(optionsHash = {}){ |taskself| … }?#

Sets up a YARD task name, passing options, on the files listed in inventory or files, with globals set, optionally yields the task object for further customization, then #defines name.

The default for options is:

--no-private --protected --private --query \
  "(!object.docstring.blank?&&object.docstring.line)||object.root?" \
--markup markdown --no-stats

This’ll make YARD output documentation for all public, protected, and private objects not markes as @private that have documentation that hasn’t been automatically generated or is the top-level namespace using Markdown as the markup format and not outputting any statistics at the end of execution.

Options
:nameSymbol = :html

The name of the task to define

:optionsArray<String, Array<String>> =

The options to pass to YARD; will be passed to Shellwords.shelljoin

:inventoryInventory = Inventory::Rake::Tasks.inventory

The inventory to use for files default

:filesArray<String> = FileList[ENV['FILES']] or inventory.lib_files

The files to process

:globalsHash = {}

The globals to pass to YARD

Instance Methods

define#

Defines the following tasks (html is actually whatever #name has been set to):

.yardopts (file)

Create .yardopts file based on #options; depends on the file defining this task and Rakefile.

html

Generate documentation in HTML format for all #files, passing #globals to YARD; depends on .yardopts file.

nameSymbol#

Returns the name to use for the task: VALUE.

name=(valueSymbol)Symbol#

Sets and returns the name to use for the task: value.

optionsArray<String, Array<String>>#

Returns the options to pass to YARD: VALUE.

options=(valueArray<String, Array<String>>)Array<String, Array<String>>#

Sets and returns the options to pass to YARD: value.

inventoryInventory#

Returns the inventory to use: VALUE.

inventory=(valueInventory)Inventory#

Sets and returns the inventory to use: value.

filesArray<String>#

Returns the files to process: VALUE.

files=(valueArray<String>)Array<String>#

Sets and returns the files to process: value.

globalsHash#

Returns the globals to pass to YARD: VALUE.

globals=(valueHash)Hash#

Sets and returns the globals to pass to YARD: value.