# phpman > ri > RDoc::Task

## [RDoc::Task](https://www.chedong.com/phpMan.php/perldoc/RDoc%3A%3ATask/markdown) < [Rake::TaskLib](https://www.chedong.com/phpMan.php/perldoc/Rake%3A%3ATaskLib/markdown)

(from gem rdoc-7.2.0)
------------------------------------------------------------------------
[RDoc::Task](https://www.chedong.com/phpMan.php/perldoc/RDoc%3A%3ATask/markdown) creates the following rake tasks to generate and clean up
RDoc output:

rdoc:
  Main task for this RDoc task.


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


rerdoc:
  Rebuild the rdoc files from scratch, even if they are not out of date.


rdoc:coverage:
  Print RDoc coverage report for all rdoc files.


Simple Example:

  require 'rdoc/task'

  [RDoc::Task](https://www.chedong.com/phpMan.php/perldoc/RDoc%3A%3ATask/markdown).new do |rdoc|
    rdoc.main = "README.md"
    rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
  end

The rdoc object passed to the block is an [RDoc::Task](https://www.chedong.com/phpMan.php/perldoc/RDoc%3A%3ATask/markdown) object. See the
attributes list for the [RDoc::Task](https://www.chedong.com/phpMan.php/perldoc/RDoc%3A%3ATask/markdown) class for available customization
options.

### Specifying different task names

You may wish to give the task a different name, such as if you are
generating two sets of documentation.  For instance, if you want to have
a development set of documentation including private methods:

  require 'rdoc/task'

  [RDoc::Task](https://www.chedong.com/phpMan.php/perldoc/RDoc%3A%3ATask/markdown).new :rdoc_dev do |rdoc|
    rdoc.main = "README.md"
    rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
    rdoc.options << "--all"
  end

The tasks would then be named :_rdoc_dev_,
:clobber__rdoc_dev_, and :re_rdoc_dev_.

If you wish to have completely different task names, then pass a Hash as
first argument. With the :rdoc, :clobber_rdoc and :rerdoc options, you
can customize the task names to your liking.

For example:

  require 'rdoc/task'

  [RDoc::Task](https://www.chedong.com/phpMan.php/perldoc/RDoc%3A%3ATask/markdown).new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean",
                 :rerdoc => "rdoc:force")

This will create the tasks :rdoc, :rdoc:clean, :rdoc:force, and
:rdoc:coverage.
------------------------------------------------------------------------
## Class methods:

  new

## Instance methods:

  before_running_rdoc
  check_names
  clobber_task_description
  clobber_task_name
  coverage_task_description
  coverage_task_name
  defaults
  define
  external
  generator
  main
  markup
  name
  option_list
  options
  rdoc_dir
  rdoc_files
  rdoc_target
  rdoc_task_description
  rdoc_task_name
  rerdoc_task_description
  rerdoc_task_name
  template
  title

## Attributes:

  attr_accessor external
  attr_accessor generator
  attr_accessor main
  attr_accessor markup
  attr_accessor name
  attr_accessor options
  attr_accessor rdoc_dir
  attr_accessor rdoc_files
  attr_accessor template
  attr_accessor title

