Permalink
Browse files

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
  • Loading branch information...
1 parent 56ae4ab commit 2af3743ba251e45c7d5467c36913d1f0377132d7 Marcel Molina committed Oct 29, 2005
Showing with 36 additions and 1 deletion.
  1. +2 −0 railties/CHANGELOG
  2. +34 −1 railties/lib/tasks/documentation.rake
View
@@ -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]
@@ -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')
-}
+}

0 comments on commit 2af3743

Please sign in to comment.