diff options
author | Rizwan Reza <rizwanreza@gmail.com> | 2010-01-24 12:29:36 +0330 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2010-01-24 13:16:38 -0800 |
commit | 396003fc48d7c0ba206ad059646c7414bee22a36 (patch) | |
tree | ed08d2e492a85e1e21ac85dc1c36f041dcab64d0 /railties | |
parent | 6e57b88c60fa3ad1ecfa740b8cd3173c4fe72680 (diff) | |
download | rails-396003fc48d7c0ba206ad059646c7414bee22a36.tar.gz rails-396003fc48d7c0ba206ad059646c7414bee22a36.tar.bz2 rails-396003fc48d7c0ba206ad059646c7414bee22a36.zip |
Revamp of Rails documentation task
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/tasks/documentation.rake | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake index 65d0d476ba..3f49a9a720 100644 --- a/railties/lib/rails/tasks/documentation.rake +++ b/railties/lib/rails/tasks/documentation.rake @@ -11,35 +11,43 @@ namespace :doc do rdoc.rdoc_files.include('lib/**/*.rb') } - desc "Generate documentation for the Rails framework" + desc 'Generate documentation for the Rails framework. Specify path with PATH="/path/to/rails"' Rake::RDocTask.new("rails") { |rdoc| + path = ENV['RAILS_PATH'] || 'vendor/gems/gems' + version = '-3.0.pre' unless ENV['RAILS_PATH'] rdoc.rdoc_dir = 'doc/api' rdoc.template = "#{ENV['template']}.rb" if ENV['template'] rdoc.title = "Rails Framework Documentation" rdoc.options << '--line-numbers' << '--inline-source' rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('vendor/rails/railties/CHANGELOG') - rdoc.rdoc_files.include('vendor/rails/railties/MIT-LICENSE') - rdoc.rdoc_files.include('vendor/rails/railties/README') - rdoc.rdoc_files.include('vendor/rails/railties/lib/{*.rb,commands/*.rb,generators/*.rb}') - rdoc.rdoc_files.include('vendor/rails/activerecord/README') - rdoc.rdoc_files.include('vendor/rails/activerecord/CHANGELOG') - rdoc.rdoc_files.include('vendor/rails/activerecord/lib/active_record/**/*.rb') - rdoc.rdoc_files.exclude('vendor/rails/activerecord/lib/active_record/vendor/*') - rdoc.rdoc_files.include('vendor/rails/activeresource/README') - rdoc.rdoc_files.include('vendor/rails/activeresource/CHANGELOG') - rdoc.rdoc_files.include('vendor/rails/activeresource/lib/active_resource.rb') - rdoc.rdoc_files.include('vendor/rails/activeresource/lib/active_resource/*') - rdoc.rdoc_files.include('vendor/rails/actionpack/README') - rdoc.rdoc_files.include('vendor/rails/actionpack/CHANGELOG') - rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_controller/**/*.rb') - rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_view/**/*.rb') - rdoc.rdoc_files.include('vendor/rails/actionmailer/README') - rdoc.rdoc_files.include('vendor/rails/actionmailer/CHANGELOG') - rdoc.rdoc_files.include('vendor/rails/actionmailer/lib/action_mailer/base.rb') - 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') + + %w(README CHANGELOG lib/action_mailer/base.rb).each do |file| + rdoc.rdoc_files.include("#{path}/actionmailer#{version}/#{file}") + end + + %w(README CHANGELOG lib/action_controller/**/*.rb lib/action_view/**/*.rb).each do |file| + rdoc.rdoc_files.include("#{path}/actionpack#{version}/#{file}") + end + + %w(README CHANGELOG lib/active_model/**/*.rb).each do |file| + rdoc.rdoc_files.include("#{path}/activemodel#{version}/#{file}") + end + + %w(README CHANGELOG lib/active_record/**/*.rb).each do |file| + rdoc.rdoc_files.include("#{path}/activerecord#{version}/#{file}") + end + + %w(README CHANGELOG lib/active_resource.rb lib/active_resource/*).each do |file| + rdoc.rdoc_files.include("#{path}/activeresource#{version}/#{file}") + end + + %w(README CHANGELOG lib/active_support/**/*.rb).each do |file| + rdoc.rdoc_files.include("#{path}/activesupport#{version}/#{file}") + end + + %w(README CHANGELOG MIT-LICENSE lib/{*.rb,commands/*.rb,generators/*.rb}).each do |file| + rdoc.rdoc_files.include("#{path}/railties#{version}/#{file}") + end } plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) } |