Parent

Syckle::Plugins::RIDoc

RI Documentation Plugin

The ri documentation plugin provides services for generating ri documentation.

By default it generates the ri documentaiton at doc/ri, unless an ‘ri’ directory exists in the project’s root directory, in which case the ri documentation will be stored there.

This plugin provides the following cycle-phases:

main:document  - generate ri docs
main:reset     - mark ri docs out-of-date
main:clean     - remove ri docs

site:document  - generate ri docs
site:reset     - mark ri docs out-of-date
site:clean     - remove ri docs

Constants

DEFAULT_EXTRA

Deafult extra options to add to rdoc call.

DEFAULT_OUTPUT

Default location to store ri documentation files.

DEFAULT_OUTPUT_MATCH

Locations to check for existance in deciding where to store ri documentation.

Attributes

exclude[RW]

Paths to specifically exclude.

extra[RW]

Additional options passed to the rdoc command.

files[RW]

Which files to include.

output[RW]

Where to save rdoc files (doc/rdoc).

Public Instance Methods

clean() click to toggle source

Remove ri products.

# File lib/plugins/syckle/ridoc.rb, line 112
def clean
  if File.directory?(output)
    rm_r(output)
    status "Removed #{output}" #unless trial?
  end
end
document() click to toggle source

Generate ri documentation. This utilizes rdoc to produce the appropriate files.

# File lib/plugins/syckle/ridoc.rb, line 77
def document
  output  = self.output
  input   = self.files
  exclude = self.exclude

  include_files = files.to_list.uniq
  exclude_files = exclude.to_list.uniq

  filelist = amass(include_files, exclude_files)

  if outofdate?(output, *filelist) or force?
    status "Generating #{output}"

    cmdopts = {}
    cmdopts['op']      = output
    cmdopts['exclude'] = exclude

    ridoc_target(output, include_files, cmdopts)

    touch(output)
  else
    status "RI docs are current (#{output})"
  end
end
initialize_defaults() click to toggle source
# File lib/plugins/syckle/ridoc.rb, line 53
def initialize_defaults
  @files  = metadata.loadpath
  @output = Dir[DEFAULT_OUTPUT_MATCH].first || DEFAULT_OUTPUT
  @extra  = DEFAULT_EXTRA
end
reset() click to toggle source

Set the output directory’s mtime to furthest time in past. This “marks” the documentation as out-of-date.

# File lib/plugins/syckle/ridoc.rb, line 104
def reset
  if File.directory?(output)
    File.utime(0,0,self.output)
    report "reset #{output}"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.