From b50635a59f7d2fab2cdba348c4169536fbbb77f4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 23 Jul 2010 21:11:29 +0200 Subject: [PATCH 1/2] update Rakefiles for RDoc 2.5 --- Rakefile | 8 +++----- actionmailer/Rakefile | 8 ++++---- actionpack/Rakefile | 8 ++++---- activemodel/Rakefile | 8 ++++---- activerecord/Rakefile | 8 ++++---- activeresource/Rakefile | 8 ++++---- activesupport/Rakefile | 8 ++++---- railties/Rakefile | 15 +++++++++++---- 8 files changed, 38 insertions(+), 33 deletions(-) diff --git a/Rakefile b/Rakefile index 835a2dec50..59f6b965f6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,8 @@ gem 'rdoc', '>= 2.5.9' require 'rdoc' -require 'horo' require 'rake' -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/gempackagetask' PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource activerecord railties) @@ -63,12 +62,11 @@ task :install => :gem do end desc "Generate documentation for the Rails framework" -Rake::RDocTask.new do |rdoc| +RDoc::Task.new do |rdoc| rdoc.rdoc_dir = 'doc/rdoc' rdoc.title = "Ruby on Rails Documentation" - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.options << '-A cattr_accessor=object' + rdoc.options << '-f' << 'horo' rdoc.options << '--charset' << 'utf-8' rdoc.options << '--main' << 'README.rdoc' diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile index 7dede3bf4f..ce5f7a36d9 100644 --- a/actionmailer/Rakefile +++ b/actionmailer/Rakefile @@ -2,7 +2,7 @@ gem 'rdoc', '>= 2.5.9' require 'rdoc' require 'rake' require 'rake/testtask' -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/packagetask' require 'rake/gempackagetask' @@ -26,12 +26,12 @@ namespace :test do end # Generate the RDoc documentation -Rake::RDocTask.new { |rdoc| +RDoc::Task.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Action Mailer -- Easy email delivery and testing" - rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' rdoc.options << '--charset' << 'utf-8' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' + rdoc.options << '-f' << 'horo' + rdoc.options << '--main' << 'README.rdoc' rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG') rdoc.rdoc_files.include('lib/action_mailer.rb') rdoc.rdoc_files.include('lib/action_mailer/*.rb') diff --git a/actionpack/Rakefile b/actionpack/Rakefile index f8b00e5327..4af8ea167a 100644 --- a/actionpack/Rakefile +++ b/actionpack/Rakefile @@ -2,7 +2,7 @@ gem 'rdoc', '>= 2.5.9' require 'rdoc' require 'rake' require 'rake/testtask' -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/packagetask' require 'rake/gempackagetask' @@ -38,12 +38,12 @@ end # Genereate the RDoc documentation -Rake::RDocTask.new { |rdoc| +RDoc::Task.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Action Pack -- On rails from request to response" - rdoc.options << '--line-numbers' << '--inline-source' rdoc.options << '--charset' << 'utf-8' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' + rdoc.options << '-f' << 'horo' + rdoc.options << '--main' << 'README.rdoc' if ENV['DOC_FILES'] rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/)) else diff --git a/activemodel/Rakefile b/activemodel/Rakefile index ec44e5fb42..3fffc0d021 100644 --- a/activemodel/Rakefile +++ b/activemodel/Rakefile @@ -23,15 +23,15 @@ namespace :test do end -require 'rake/rdoctask' +require 'rdoc/task' # Generate the RDoc documentation -Rake::RDocTask.new do |rdoc| +RDoc::Task.new do |rdoc| rdoc.rdoc_dir = "doc" rdoc.title = "Active Model" - rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' + rdoc.options << '-f' << 'horo' rdoc.options << '--charset' << 'utf-8' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' + rdoc.options << '--main' << 'README.rdoc' rdoc.rdoc_files.include("README.rdoc", "CHANGELOG") rdoc.rdoc_files.include("lib/**/*.rb") end diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 8d81622760..66ebb6344c 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -2,7 +2,7 @@ gem 'rdoc', '>= 2.5.9' require 'rdoc' require 'rake' require 'rake/testtask' -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/packagetask' require 'rake/gempackagetask' @@ -166,12 +166,12 @@ task :rebuild_frontbase_databases => 'frontbase:rebuild_databases' # Generate the RDoc documentation -Rake::RDocTask.new { |rdoc| +RDoc::Task.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Active Record -- Object-relation mapping put on rails" - rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' + rdoc.options << '-f' << 'horo' + rdoc.options << '--main' << 'README.rdoc' rdoc.options << '--charset' << 'utf-8' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' rdoc.rdoc_files.include('README.rdoc', 'RUNNING_UNIT_TESTS', 'CHANGELOG') rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_files.exclude('lib/active_record/vendor/*') diff --git a/activeresource/Rakefile b/activeresource/Rakefile index 43b2d15916..63444be1d0 100644 --- a/activeresource/Rakefile +++ b/activeresource/Rakefile @@ -2,7 +2,7 @@ gem 'rdoc', '>= 2.5.9' require 'rdoc' require 'rake' require 'rake/testtask' -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/packagetask' require 'rake/gempackagetask' @@ -29,12 +29,12 @@ end # Generate the RDoc documentation -Rake::RDocTask.new { |rdoc| +RDoc::Task.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Active Resource -- Object-oriented REST services" - rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' + rdoc.options << '-f' << 'horo' + rdoc.options << '--main' << 'README.rdoc' rdoc.options << '--charset' << 'utf-8' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG') rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_files.exclude('lib/activeresource.rb') diff --git a/activesupport/Rakefile b/activesupport/Rakefile index 922e0da236..28426f94ea 100644 --- a/activesupport/Rakefile +++ b/activesupport/Rakefile @@ -1,7 +1,7 @@ gem 'rdoc', '>= 2.5.9' require 'rdoc' require 'rake/testtask' -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/gempackagetask' task :default => :test @@ -22,12 +22,12 @@ dist_dirs = [ "lib", "test"] # Genereate the RDoc documentation -Rake::RDocTask.new { |rdoc| +RDoc::Task.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Active Support -- Utility classes and standard library extensions from Rails" - rdoc.options << '--line-numbers' << '--inline-source' + rdoc.options << '-f' << 'horo' + rdoc.options << '--main' << 'README.rdoc' rdoc.options << '--charset' << 'utf-8' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG') rdoc.rdoc_files.include('lib/active_support.rb') rdoc.rdoc_files.include('lib/active_support/**/*.rb') diff --git a/railties/Rakefile b/railties/Rakefile index 1600fc8871..8e78d2ff4a 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -2,7 +2,7 @@ gem 'rdoc', '>= 2.5.9' require 'rdoc' require 'rake' require 'rake/testtask' -require 'rake/rdoctask' +require 'rdoc/task' require 'rake/gempackagetask' require 'date' @@ -35,6 +35,13 @@ end # Update spinoffs ------------------------------------------------------------------- +desc "Updates application README to the latest version Railties README" +task :update_readme do + readme = "lib/rails/generators/rails/app/templates/README" + rm readme + cp "./README.rdoc", readme +end + desc 'Generate guides (for authors), use ONLY=foo to process just "foo.textile"' task :generate_guides do ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this @@ -53,12 +60,12 @@ end # Generate documentation ------------------------------------------------------------------ -Rake::RDocTask.new { |rdoc| +RDoc::Task.new { |rdoc| rdoc.rdoc_dir = 'doc' rdoc.title = "Railties -- Gluing the Engine to the Rails" - rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object' + rdoc.options << '-f' << 'horo' + rdoc.options << '--main' << 'README.rdoc' rdoc.options << '--charset' << 'utf-8' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG') rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_files.exclude('lib/rails/generators/**/templates/*') From 728ba209e7ec3126848ec58cc1388e9eff8145e5 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 24 Jul 2010 00:35:22 +0200 Subject: [PATCH 2/2] include the root README.rdoc as main page --- Rakefile | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Rakefile b/Rakefile index 59f6b965f6..4d9e80eb9d 100644 --- a/Rakefile +++ b/Rakefile @@ -10,7 +10,7 @@ PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource a desc 'Run all tests by default' task :default => %w(test test:isolated) -%w(test test:isolated rdoc package gem).each do |task_name| +%w(test test:isolated package gem).each do |task_name| desc "Run #{task_name} task for all projects" task task_name do errors = [] @@ -67,18 +67,10 @@ RDoc::Task.new do |rdoc| rdoc.title = "Ruby on Rails Documentation" rdoc.options << '-f' << 'horo' - rdoc.options << '--charset' << 'utf-8' - rdoc.options << '--main' << 'README.rdoc' + rdoc.options << '-c' << 'utf-8' + rdoc.options << '-m' << 'README.rdoc' - # Workaround: RDoc assumes that rdoc.template can be required, and that - # rdoc.template.upcase is a constant living in RDoc::Generator::HTML - # which holds the actual template class. - # - # We put 'doc/template' in the load path to be able to set the template - # to the string 'horo' and thus meet those RDoc's assumptions. - $:.unshift('doc/template') - - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : 'horo' + rdoc.rdoc_files.include('README.rdoc') rdoc.rdoc_files.include('railties/CHANGELOG') rdoc.rdoc_files.include('railties/MIT-LICENSE')