class RDoc::Task

def define

def define
  desc rdoc_task_description
  task rdoc_task_name
  desc rerdoc_task_description
  task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
  desc clobber_task_description
  task clobber_task_name do
    rm_r @rdoc_dir rescue nil
  end
  task :clobber => [clobber_task_name]
  directory @rdoc_dir
  rdoc_target_deps = [
    @rdoc_files,
    Rake.application.rakefile
  ].flatten.compact
  task rdoc_task_name => [rdoc_target]
  file rdoc_target => rdoc_target_deps do
    @before_running_rdoc.call if @before_running_rdoc
    args = option_list + @rdoc_files
    $stderr.puts "rdoc #{args.join ' '}" if Rake.application.options.trace
    RDoc::RDoc.new.document args
  end
  namespace rdoc_task_name do
    desc coverage_task_description
    task coverage_task_name do
      @before_running_rdoc.call if @before_running_rdoc
      opts = option_list << "-C"
      args = opts + @rdoc_files
      $stderr.puts "rdoc #{args.join ' '}" if Rake.application.options.trace
      RDoc::RDoc.new.document args
    end
  end
  self
end