Class: Toe::Rdoc

Inherits:
GemTask
  • Object
show all
Defined in:
lib/toe/rdoc.rb

Overview

:startdoc::task generate rdoc

Instance Method Summary collapse

Methods inherited from GemTask

#default_path, #gemspec

Instance Method Details

#optionsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/toe/rdoc.rb', line 13

def options
  opts = []
  
  if output_dir
    opts << '--op'
    opts << output_dir
  end
  
  if cdoc
    opts.concat %w{
      --fmt cdoc 
      --template cdoc/cdoc_html_template
    }
  end
  
  if force
    opts << '--force-update'
  end
  
  opts
end

#process(path = default_path) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/toe/rdoc.rb', line 35

def process(path=default_path)
  spec = gemspec(path)

  files = spec.files.select {|file|
    file =~ /lib.*\.rb$/
  } + spec.extra_rdoc_files
  
  args = options + spec.rdoc_options + files.uniq
  RDoc::RDoc.new.document(args)
end