123456789_123456789_123456789_123456789_123456789_

Class: YARD::Rake::YardocTask

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Rake::TaskLib
Instance Chain:
self, Rake::TaskLib
Inherits: Rake::TaskLib
  • Object
Defined in: lib/yard/rake/yardoc_task.rb

Overview

The rake task to run ::YARD::CLI::Yardoc and generate documentation.

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(name = :yard) {|_self| ... } ⇒ YardocTask

Creates a new task with name #name.

Parameters:

  • name (String, Symbol) (defaults to: :yard)

    the name of the rake task

Yields:

  • a block to allow any options to be modified on the task

Yield Parameters:

  • _self (YardocTask)

    the task object to allow any parameters to be changed.

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 50

def initialize(name = :yard)
  @name = name
  @options = []
  @stats_options = []
  @files = []

  yield self if block_given?
  self.options += ENV['OPTS'].split(/[ ,]/) if ENV['OPTS']
  self.files   += ENV['FILES'].split(/[ ,]/) if ENV['FILES']
  self.options << '--no-stats' unless stats_options.empty?

  define
end

Instance Attribute Details

#afterProc (rw)

Runs a Proc after the task

Returns:

  • (Proc)

    a proc to call after running the task

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 36

attr_accessor :after

#beforeProc (rw)

Runs a Proc before the task

Returns:

  • (Proc)

    a proc to call before running the task

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 32

attr_accessor :before

#filesArray<String> (rw)

The Ruby source files (and any extra documentation files separated by '-') to process.

Examples:

Task files assignment

YARD::Rake::YardocTask.new do |t|
  t.files   = ['app/**/*.rb', 'lib/**/*.rb', '-', 'doc/FAQ.md', 'doc/Changes.md']
end

Returns:

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 28

attr_accessor :files

#nameString (rw)

The name of the task

Returns:

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 11

attr_accessor :name

#optionsArray<String> (rw)

Returns:

  • (Array<String>)

    the options passed to the commandline utility

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 15

attr_accessor :options

#stats_optionsArray<String> (rw)

Returns:

  • (Array<String>)

    the options passed to the stats utility

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 19

attr_accessor :stats_options

#verifierVerifier, Proc (rw)

Returns:

  • (Verifier, Proc)

    an optional ::YARD::Verifier to run against all objects being generated. Any object that the verifier returns false for will be excluded from documentation. This attribute can also be a lambda.

See Also:

[ GitHub ]

  
# File 'lib/yard/rake/yardoc_task.rb', line 42

attr_accessor :verifier