class Rake::RDocTask


:rerdoc_dev.
The tasks would then be named :rdoc_dev, :clobber_rdoc_dev, and
end
rd.options << “–all”
rd.rdoc_files.include(“README.rdoc”, “lib/*/.rb”)
rd.main = “README.doc”
Rake::RDocTask.new(:rdoc_dev) do |rd|
development set of documentation including private methods:
generating two sets of documentation. For instance, if you want to have a
You may wish to give the task a different name, such as if you are
end
rd.rdoc_files.include(“README.rdoc”, “lib/*/.rb”)
rd.main = “README.rdoc”
Rake::RDocTask.new do |rd|
Simple Example:
of date.
Rebuild the rdoc files from scratch, even if they are not out
[:rerdoc]

added to the main clobber target.
Delete all the rdoc files. This target is automatically
[:clobber_rdoc]

Main task for this RDOC task.
[rdoc]

The RDocTask will create the following targets:
a project.
Create a documentation task that will generate the RDoc files for

def define

Create the tasks defined by this task lib.
def define
  if name.to_s != "rdoc"
    desc "Build the RDOC HTML Files"
  end
  desc "Build the #{name} HTML Files"
  task name
  
  desc "Force a rebuild of the RDOC files"
  task paste("re", name) => [paste("clobber_", name), name]
  
  desc "Remove rdoc products" 
  task paste("clobber_", name) do
    rm_r rdoc_dir rescue nil
  end
  task :clobber => [paste("clobber_", name)]
  
  directory @rdoc_dir
  task name => [rdoc_target]
  file rdoc_target => @rdoc_files + [$rakefile] do
    rm_r @rdoc_dir rescue nil
    args = option_list + @rdoc_files
    if @external
      argstring = args.join(' ')
      sh %{ruby -Ivendor vender/rd #{argstring}}
    else
      require 'rdoc/rdoc'
      RDoc::RDoc.new.document(args)
    end
  end
  self
end

def initialize(name=:rdoc) # :yield: self

:yield: self
Create an RDoc task named rdoc. Default task name is +rdoc+.
def initialize(name=:rdoc)  # :yield: self
  @name = name
  @rdoc_files = Rake::FileList.new
  @rdoc_dir = 'html'
  @main = nil
  @title = nil
  @template = 'html'
  @external = false
  @options = []
  yield self if block_given?
  define
end

def option_list

def option_list
  result = @options.dup
  result << "-o" << @rdoc_dir
  result << "--main" << quote(main) if main
  result << "--title" << quote(title) if title
  result << "-T" << quote(template) if template
  result
end

def option_string

def option_string
  option_list.join(' ')
end

def quote(str)

def quote(str)
  if @external
    "'#{str}'"
  else
    str
  end
end

def rdoc_target

def rdoc_target
  "#{rdoc_dir}/index.html"
end