diff --git a/Gemfile b/Gemfile index 19e532bc0b..fe6ef9aa8a 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ gem "rails", :path => File.dirname(__FILE__) gem "rake", ">= 0.8.7" gem "mocha", ">= 0.9.8" +gem "rdoc", "2.2" mri = !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" if mri && RUBY_VERSION < '1.9' @@ -44,10 +45,6 @@ elsif RUBY_ENGINE == "jruby" end end -group :documentation do - gem 'rdoc', '2.1' -end - if ENV['CI'] gem "nokogiri", ">= 1.4.0" diff --git a/Rakefile b/Rakefile index 0ee7647a12..e608af0319 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,6 @@ +gem 'rdoc', '= 2.2' +require 'rdoc' + require 'rake' require 'rake/rdoctask' require 'rake/gempackagetask' @@ -68,7 +71,15 @@ Rake::RDocTask.new do |rdoc| rdoc.options << '--charset' << 'utf-8' rdoc.options << '--main' << 'railties/README' - rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : './doc/template/horo' + # 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('railties/CHANGELOG') rdoc.rdoc_files.include('railties/MIT-LICENSE') @@ -117,7 +128,7 @@ end desc "Publish API docs for Rails as a whole and for each component" task :pdoc => :rdoc do require 'rake/contrib/sshpublisher' - Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/api", "doc/rdoc").upload + Rake::SshDirPublisher.new("rails@api.rubyonrails.org", "public_html/api", "doc/rdoc").upload PROJECTS.each do |project| system %(cd #{project} && #{$0} pdoc) end diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile index 5b72843f5e..f20e7ea928 100644 --- a/actionmailer/Rakefile +++ b/actionmailer/Rakefile @@ -1,4 +1,5 @@ -require 'rubygems' +gem 'rdoc', '= 2.2' +require 'rdoc' require 'rake' require 'rake/testtask' require 'rake/rdoctask' @@ -53,5 +54,5 @@ end desc "Publish the API documentation" task :pdoc => [:rdoc] do require 'rake/contrib/sshpublisher' - Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload + Rake::SshDirPublisher.new("rails@api.rubyonrails.org", "public_html/am", "doc").upload end diff --git a/actionpack/Rakefile b/actionpack/Rakefile index f3bd7dfc10..aed5278e38 100644 --- a/actionpack/Rakefile +++ b/actionpack/Rakefile @@ -1,4 +1,5 @@ -require 'rubygems' +gem 'rdoc', '= 2.2' +require 'rdoc' require 'rake' require 'rake/testtask' require 'rake/rdoctask' diff --git a/activemodel/Rakefile b/activemodel/Rakefile index d4a00c5073..1dba664539 100755 --- a/activemodel/Rakefile +++ b/activemodel/Rakefile @@ -1,5 +1,8 @@ dir = File.dirname(__FILE__) +gem 'rdoc', '= 2.2' +require 'rdoc' + require 'rake/testtask' task :default => :test diff --git a/activerecord/Rakefile b/activerecord/Rakefile index bf05389eae..12e094b406 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -1,4 +1,5 @@ -require 'rubygems' +gem 'rdoc', '= 2.2' +require 'rdoc' require 'rake' require 'rake/testtask' require 'rake/rdoctask' @@ -222,5 +223,5 @@ end desc "Publish the API documentation" task :pdoc => [:rdoc] do require 'rake/contrib/sshpublisher' - Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload + Rake::SshDirPublisher.new("rails@api.rubyonrails.org", "public_html/ar", "doc").upload end diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index ddadde8dcf..6fe3b01281 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -1032,7 +1032,7 @@ if ActiveRecord::Base.connection.supports_migrations? elsif current_adapter?(:SQLiteAdapter) # - SQLite3 stores a float, in violation of SQL assert_kind_of BigDecimal, b.value_of_e - assert_equal BigDecimal("2.71828182845905"), b.value_of_e + assert_in_delta BigDecimal("2.71828182845905"), b.value_of_e, 0.00000000000001 else # - SQL standard is an integer assert_kind_of Fixnum, b.value_of_e diff --git a/activeresource/Rakefile b/activeresource/Rakefile index 175b379699..04b08ed8cb 100644 --- a/activeresource/Rakefile +++ b/activeresource/Rakefile @@ -1,4 +1,5 @@ -require 'rubygems' +gem 'rdoc', '= 2.2' +require 'rdoc' require 'rake' require 'rake/testtask' require 'rake/rdoctask' @@ -83,5 +84,5 @@ end desc "Publish the API documentation" task :pdoc => [:rdoc] do require 'rake/contrib/sshpublisher' - Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ar", "doc").upload + Rake::SshDirPublisher.new("rails@api.rubyonrails.org", "public_html/ar", "doc").upload end diff --git a/activesupport/Rakefile b/activesupport/Rakefile index 43f4722dbc..2aebe05de2 100644 --- a/activesupport/Rakefile +++ b/activesupport/Rakefile @@ -1,3 +1,5 @@ +gem 'rdoc', '= 2.2' +require 'rdoc' require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' @@ -47,5 +49,5 @@ end desc "Publish the API documentation" task :pdoc => [:rdoc] do require 'rake/contrib/sshpublisher' - Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/as", "doc").upload + Rake::SshDirPublisher.new("rails@api.rubyonrails.org", "public_html/as", "doc").upload end diff --git a/doc/template/horo.rb b/doc/template/horo.rb index e028422a2e..b38fa28cde 100644 --- a/doc/template/horo.rb +++ b/doc/template/horo.rb @@ -11,8 +11,12 @@ if defined?(RDoc::Diagram) end end +require 'rdoc/generator/html' + module RDoc -module Page +module Generator +class HTML +class HORO FONTS = "\"Bitstream Vera Sans\", Verdana, Arial, Helvetica, sans-serif" @@ -28,7 +32,7 @@ a:hover { } body, td, p { - font-family: %fonts%; + font-family: <%= values['fonts'] %>; background: #FFF; color: #000; margin: 0px; @@ -206,7 +210,7 @@ dd { } CSS -XHTML_PREAMBLE = %{ +XHTML_PREAMBLE = %{"?> @@ -221,9 +225,9 @@ XHTML_FRAMESET_PREAMBLE = %{ HEADER = XHTML_PREAMBLE + < - %title% - - + <%= values['title'] %> + +