Class: Detroit::Qedoc

Inherits:
Tool
  • Object
show all
Defined in:
lib/detroit-qedoc.rb

Overview

QED documentation tool.

QED can generate an HTML representation of the QED documents.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filesObject

Demonstration files (or globs).



18
19
20
# File 'lib/detroit-qedoc.rb', line 18

def files
  @files
end

#outputObject

Output file(s) to generate QEDocs.



28
29
30
# File 'lib/detroit-qedoc.rb', line 28

def output
  @output
end

#stylesheetObject

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



22
23
24
# File 'lib/detroit-qedoc.rb', line 22

def stylesheet
  @stylesheet
end

#titleObject

Optional title to use in QEDdocs.



25
26
27
# File 'lib/detroit-qedoc.rb', line 25

def title
  @title
end

Class Method Details

.man_pageObject



125
126
127
# File 'lib/detroit-qedoc.rb', line 125

def self.man_page
  File.dirname(__FILE__)+'/../man/detroit-qedoc.5'  
end

Instance Method Details

#assemble(station, options = {}) ⇒ Object



55
56
57
58
59
60
61
62
# 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 = {}) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
48
49
50
51
52
# 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

#cleanObject

noop



93
94
# File 'lib/detroit-qedoc.rb', line 93

def clean
end

#documentObject



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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

#purgeObject

Remove qedoc output directory.



97
98
99
100
101
102
# File 'lib/detroit-qedoc.rb', line 97

def purge
  if directory?(output)
    rm_r(output)
    status "Removed #{output}" unless trial?
  end
end

#resetObject

Mark the output directory as out of date.



85
86
87
88
89
90
# File 'lib/detroit-qedoc.rb', line 85

def reset
  if directory?(output)
    utime(0, 0, output)
    report "Reset #{output}" #unless trial?
  end
end