Class: Shoe::Tasks::Rdoc

Inherits:
Task
  • Object
show all
Defined in:
lib/shoe/tasks/rdoc.rb

Overview

Defines `rake rdoc` to generate project documentation.

Uses {Gem::DocManager}[http://rubygems.rubyforge.org/rubygems-update/Gem/DocManager.html], so rdoc is generated locally just as it will be with `gem install` and `gem rdoc`. Your users will thank you for making sure their local documentation looks nice.

(Incidentally, this is why Shoe prefers rdoc (the file format) over Markdown and rdoc (the tool) over YARD, even though both have considerable advantages – it’s what your users are going to get!)

This task is always enabled.

To configure, add rdoc_options[http://docs.rubygems.org/read/chapter/20#rdoc_options] and extra_rdoc_files[http://docs.rubygems.org/read/chapter/20#extra_rdoc_files] to your gemspec.

Instance Attribute Summary

Attributes inherited from Task

#spec

Instance Method Summary collapse

Methods inherited from Task

#initialize

Constructor Details

This class inherits a constructor from Shoe::Tasks::Task

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/shoe/tasks/rdoc.rb', line 26

def active?
  true
end

#defineObject



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/shoe/tasks/rdoc.rb', line 30

def define
  desc <<-END.gsub(/^ */, '')
    Generate documentation.
    Configure via the `rdoc_options` and `extra_rdoc_files` fields in
    #{spec.name}.gemspec. Open in a different browser by setting the
    BROWSER environment variable.
  END
  task :rdoc do
    Gem::DocManager.new(spec).extend(Extensions::DocManager).generate_rdoc
    Shoe.browse('rdoc/index.html')
  end
end