1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
begin
require 'yard'
namespace :doc do
desc "Clean up generated documentation"
task :clean do
rm_rf "doc"
end
desc "Generate public documentation pages for the API"
YARD::Rake::YardocTask.new(:api) do |t|
t.files = ['lib/**/*.rb']
t.options = %w{
--protected
--private
--verbose
--markup markdown
--readme README.md
--tag status
--transitive-tag status
--tag comment
--hide-tag comment
--tag dsl:"DSL"
--no-transitive-tag api
--template-path yardoc/templates
--files README_DEVELOPER.md,CO*.md,api/**/*.md
--api public
--api private
--hide-void-return
}
end
desc "Generate documentation pages for all of the code"
YARD::Rake::YardocTask.new(:all) do |t|
t.files = ['lib/**/*.rb']
t.options = %w{
--verbose
--markup markdown
--readme README.md
--tag status
--transitive-tag status
--tag comment
--hide-tag comment
--tag dsl:"DSL"
--no-transitive-tag api
--template-path yardoc/templates
--files README_DEVELOPER.md,CO*.md,api/**/*.md
--api public
--api private
--no-api
--hide-void-return
}
end
end
rescue LoadError => e
if verbose
STDERR.puts "Document generation not available without yard. #{e.message}"
end
end
|