diff options
author | Marcel Molina <marcel@vernix.org> | 2005-10-29 15:52:07 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2005-10-29 15:52:07 +0000 |
commit | 2af3743ba251e45c7d5467c36913d1f0377132d7 (patch) | |
tree | 882c7f436218ec402a1fae85860a01bb8ec11413 | |
parent | 56ae4ab54783dd337bd909866b1461b306ceb175 (diff) | |
download | rails-2af3743ba251e45c7d5467c36913d1f0377132d7.tar.gz rails-2af3743ba251e45c7d5467c36913d1f0377132d7.tar.bz2 rails-2af3743ba251e45c7d5467c36913d1f0377132d7.zip |
Add task to generate rdoc for all installed plugins.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2812 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/tasks/documentation.rake | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index b66706f89a..bd0514a530 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add task to generate rdoc for all installed plugins. [Marcel Molina] + * Update script.aculo.us to V1.5_rc4 [Thomas Fuchs] * Add default Mac + DarwinPorts MySQL socket locations to the app generator. [Jeremy Kemper] diff --git a/railties/lib/tasks/documentation.rake b/railties/lib/tasks/documentation.rake index 9d8fc6383c..3a5b914644 100644 --- a/railties/lib/tasks/documentation.rake +++ b/railties/lib/tasks/documentation.rake @@ -7,6 +7,39 @@ Rake::RDocTask.new("appdoc") { |rdoc| rdoc.rdoc_files.include('app/**/*.rb') } +Plugins = FileList['vendor/plugins/**'].map {|plugin| File.basename(plugin)} +# Define doc tasks for each plugin +Plugins.each do |plugin| + task :"#{plugin}_plugindoc" => :environment do + 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' + + 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 + +desc "Generate documation for all installed plugins" +task :plugindoc => Plugins.map {|plugin| :"#{plugin}_plugindoc"} + +desc "Remove plugin documentation" +task :clobber_plugindoc do + rm_rf 'doc/plugins' rescue nil +end + desc "Generate documentation for the Rails framework" Rake::RDocTask.new("apidoc") { |rdoc| rdoc.rdoc_dir = 'doc/api' @@ -41,4 +74,4 @@ Rake::RDocTask.new("apidoc") { |rdoc| rdoc.rdoc_files.include('vendor/rails/activesupport/README') rdoc.rdoc_files.include('vendor/rails/activesupport/CHANGELOG') rdoc.rdoc_files.include('vendor/rails/activesupport/lib/active_support/**/*.rb') -}
\ No newline at end of file +} |