Class: Rake::Leaves::HeaderDocTask

Inherits:
TaskLib
  • Object
show all
Defined in:
lib/leaves/doc/headerdoc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from TaskLib

#upaste

Constructor Details

#initialize {|_self| ... } ⇒ HeaderDocTask

Returns a new instance of HeaderDocTask.

Yields:

  • (_self)

Yield Parameters:



14
15
16
17
18
19
20
# File 'lib/leaves/doc/headerdoc.rb', line 14

def initialize()
  @files = Rake::FileList.new('./include')
  @output = './doc'
  
  yield self if block_given?
  define
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



12
13
14
# File 'lib/leaves/doc/headerdoc.rb', line 12

def config
  @config
end

#filesObject

Returns the value of attribute files.



10
11
12
# File 'lib/leaves/doc/headerdoc.rb', line 10

def files
  @files
end

#outputObject

Returns the value of attribute output.



11
12
13
# File 'lib/leaves/doc/headerdoc.rb', line 11

def output
  @output
end

Instance Method Details

#defineObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/leaves/doc/headerdoc.rb', line 22

def define
  desc "Generate documentation using HeaderDoc."
  task :doc do
    @files.each do |file|
      cmd = "headerdoc2html"
      cmd << " -c #{@config}" if @config
      cmd << " -o #{@output} #{file}"
      
      sh cmd
    end
    sh "gatherheaderdoc #{@output}"
  end
  
  task :clobber_doc do
    rm_r @output rescue nil
  end
  
  task :clobber => [:clobber_doc]
  
  self
end