You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

35 lines
1.1 KiB

# desc "Explaining what the task does"
# task :portugues do
# # Task goes here
# end
desc "Generate documation for Brazilian Rails plugins"
namespace :gerar_doc do
namespace :plugins do
plugin = 'brazilian-rails'
doc_base = "doc/plugins/#{plugin}"
task(plugin => :environment) do
FileUtils.remove_dir(doc_base, true)
plugin_base = "vendor/plugins/#{plugin}"
options = []
files = Rake::FileList.new
options << "-o doc/plugins/#{plugin}"
options << "--title '#{plugin.titlecase} Plugin Documentation'"
options << '--line-numbers' << '--inline-source'
options << '-T html'
options << '--charset UTF8'
files.include("#{plugin_base}/lib/**/*.rb")
if File.exists?("#{plugin_base}/README")
files.include("#{plugin_base}/README")
options << "--main '#{plugin_base}/README'"
end
files.include("#{plugin_base}/CHANGELOG") if File.exists?("#{plugin_base}/CHANGELOG")
options << files.to_s
sh %(rdoc #{options * ' '})
end
end
end