class Detroit::Qedoc

QED documentation tool.

QED can generate an HTML representation of the QED documents.

Attributes

files[RW]

Demonstration files (or globs).

output[R]

Output file(s) to generate QEDocs.

stylesheet[RW]

Relative reference to css stylesheet for QEDocs. (Only useful to HTML format.)

title[RW]

Optional title to use in QEDdocs.

Public Class Methods

man_page() click to toggle source
# File lib/detroit-qedoc.rb, line 125
def self.man_page
  File.dirname(__FILE__)+'/../man/detroit-qedoc.5'  
end

Public Instance Methods

assemble(station, options={}) click to toggle source
# File lib/detroit-qedoc.rb, line 55
def assemble(station, options={})
  case station
  when :document then document
  when :reset    then reset
  when :clean    then clean
  when :purge    then purge
  end
end
assemble?(station, options={}) click to toggle source
# File lib/detroit-qedoc.rb, line 45
def assemble?(station, options={})
  case station
  when :document then true
  when :reset    then true
  when :clean    then true
  when :purge    then true
  end
end
clean() click to toggle source

noop

# File lib/detroit-qedoc.rb, line 93
def clean
end
document() click to toggle source
# File lib/detroit-qedoc.rb, line 68
def document
  options = {}
  options[:paths]  = files
  options[:css]    = stylesheet
  options[:title]  = title
  options[:dryrun] = dryrun?
  options[:quiet]  = quiet?

  output_files.each do |f|
    options[:output] = f

    doc = QED::Document.new(options)
    doc.generate
  end
end
output=(output) click to toggle source
# File lib/detroit-qedoc.rb, line 31
def output=(output)
  case output
  when Array
    output.each{ |path| assert_path(path) }
  else
    assert_path(path)
  end
  @output = output
end
purge() click to toggle source

Remove qedoc output directory.

# File lib/detroit-qedoc.rb, line 97
def purge
  if directory?(output)
    rm_r(output)
    status "Removed #{output}" unless trial?
  end
end
reset() click to toggle source

Mark the output directory as out of date.

# File lib/detroit-qedoc.rb, line 85
def reset
  if directory?(output)
    utime(0, 0, output)
    report "Reset #{output}" #unless trial?
  end
end

Private Instance Methods

assert_path(path) click to toggle source
# File lib/detroit-qedoc.rb, line 116
def assert_path(path)
  valid = true
  valid = false if not String === path
  valid = false if path.empty?
  raise "qedoc: not a valid path -- #{path.inspect}" unless valid
end
initialize_requires() click to toggle source
# File lib/detroit-qedoc.rb, line 106
def initialize_requires
  require 'qed/document'
end
output_files() click to toggle source
# File lib/detroit-qedoc.rb, line 111
def output_files
  [output].flatten
end