Method: Inventory::Rake::Tasks::YARD#initialize
- Defined in:
- lib/inventory-rake-tasks-yard-1.0.rb
#initialize(options = {}) {|?| ... } ⇒ YARD
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.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/inventory-rake-tasks-yard-1.0.rb', line 50 def initialize( = {}) self.name = .fetch(:name, :html) self. = .fetch(:options, ['--no-private', '--protected', '--private', ['--query', %w{'(!object.docstring.blank?&&object.docstring.line)||object.root?'}], ['--markup', 'markdown'], '--no-stats']) self.inventory = .fetch(:inventory, Inventory::Rake::Tasks.inventory) self.files = .fetch(:files){ ENV.include?('FILES') ? FileList[ENV['FILES']] : (n = 0; inventory.lib_files.sort_by{ |e| [e.count('/'), n += 1] }) } self.globals = .fetch(:globals, {}) yield self if block_given? define end |