diff options
| -rw-r--r-- | Gemfile | 5 | ||||
| -rw-r--r-- | Rakefile | 15 | ||||
| -rw-r--r-- | actionmailer/Rakefile | 5 | ||||
| -rw-r--r-- | actionpack/Rakefile | 3 | ||||
| -rwxr-xr-x | activemodel/Rakefile | 3 | ||||
| -rw-r--r-- | activerecord/Rakefile | 5 | ||||
| -rw-r--r-- | activerecord/test/cases/migration_test.rb | 2 | ||||
| -rw-r--r-- | activeresource/Rakefile | 5 | ||||
| -rw-r--r-- | activesupport/Rakefile | 4 | ||||
| -rw-r--r-- | doc/template/horo.rb | 259 | ||||
| -rw-r--r-- | railties/Rakefile | 2 | 
11 files changed, 166 insertions, 142 deletions
| @@ -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" @@ -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 = %{<?xml version="1.0" encoding="%charset%"?> +XHTML_PREAMBLE = %{<?xml version="1.0" encoding="<%= values['charset'] %>"?>  <!DOCTYPE html        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> @@ -221,9 +225,9 @@ XHTML_FRAMESET_PREAMBLE = %{  HEADER = XHTML_PREAMBLE + <<ENDHEADER  <html>    <head> -    <title>%title%</title> -    <meta http-equiv="Content-Type" content="text/html; charset=%charset%" /> -    <link rel="stylesheet" href="%style_url%" type="text/css" media="screen" /> +    <title><%= values['title'] %></title> +    <meta http-equiv="Content-Type" content="text/html; charset=<%= values['charset'] %>" /> +    <link rel="stylesheet" href="<%= values['style_url'] %>" type="text/css" media="screen" />      <script language="JavaScript" type="text/javascript">      // <![CDATA[ @@ -273,20 +277,20 @@ FILE_PAGE = <<HTML  <table border='0' cellpadding='0' cellspacing='0' width="100%" class='banner'>    <tr><td>      <table width="100%" border='0' cellpadding='0' cellspacing='0'><tr> -      <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br />%short_name%</td> +      <td class="file-title" colspan="2"><span class="file-title-prefix">File</span><br /><%= values['short_name'] %></td>        <td align="right">          <table border='0' cellspacing="0" cellpadding="2">            <tr>              <td>Path:</td> -            <td>%full_path% -IF:cvsurl -				 (<a href="%cvsurl%">CVS</a>) -ENDIF:cvsurl +            <td><%= values['full_path'] %> +<% if values['cvsurl'] %> +				 (<a href="<%= values['cvsurl'] %>">CVS</a>) +<% end %>              </td>            </tr>            <tr>              <td>Modified:</td> -            <td>%dtm_modified%</td> +            <td><%= values['dtm_modified'] %></td>            </tr>          </table>        </td></tr> @@ -299,34 +303,34 @@ HTML  CLASS_PAGE = <<HTML  <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr> -  <td class="file-title"><span class="file-title-prefix">%classmod%</span><br />%full_name%</td> +  <td class="file-title"><span class="file-title-prefix"><%= values['classmod'] %></span><br /><%= values['full_name'] %></td>    <td align="right">      <table cellspacing="0" cellpadding="2">        <tr valign="top">          <td>In:</td>          <td> -START:infiles -HREF:full_path_url:full_path: -IF:cvsurl - (<a href="%cvsurl%">CVS</a>) -ENDIF:cvsurl -END:infiles +<% values['infiles'].each do |infile| %> +<%= href infile['full_path_url'], infile['full_path'] %>: +<% if infile['cvsurl'] %> + (<a href="<%= infile['cvsurl'] %>">CVS</a>) +<% end %> +<% end %>          </td>        </tr> -IF:parent +<% if values['parent'] %>      <tr>        <td>Parent:</td>        <td> -IF:par_url -        <a href="%par_url%"> -ENDIF:par_url -%parent% -IF:par_url +<% if values['par_url'] %> +        <a href="<%= values['par_url'] %>"> +<% end %> +<%= values['parent'] %> +<% if values['par_url'] %>           </a> -ENDIF:par_url +<% end %>       </td>     </tr> -ENDIF:parent +<% end %>           </table>          </td>          </tr> @@ -337,149 +341,149 @@ HTML  METHOD_LIST = <<HTML    <div id="content"> -IF:diagram +<% if values['diagram'] %>    <table cellpadding='0' cellspacing='0' border='0' width="100%"><tr><td align="center"> -    %diagram% +    <%= values['diagram'] %>    </td></tr></table> -ENDIF:diagram +<% end %> -IF:description -  <div class="description">%description%</div> -ENDIF:description +<% if values['description'] %> +  <div class="description"><%= values['description'] %></div> +<% end %> -IF:requires +<% if values['requires'] %>    <div class="sectiontitle">Required Files</div>    <ul> -START:requires -  <li>HREF:aref:name:</li> -END:requires +<% values['requires'].each do |require| %> +  <li><%= href require['aref'], require['name'] %>:</li> +<% end %>    </ul> -ENDIF:requires +<% end %> -IF:toc +<% if values['toc'] %>    <div class="sectiontitle">Contents</div>    <ul> -START:toc -  <li><a href="#%href%">%secname%</a></li> -END:toc +<% values['toc'].each do |toc| %> +  <li><a href="#<%= toc['href'] %>"><%= toc['secname'] %></a></li> +<% end %>    </ul> -ENDIF:toc +<% end %> -IF:methods +<% if values['methods'] %>    <div class="sectiontitle">Methods</div>    <ul> -START:methods -  <li>HREF:aref:name:</li> -END:methods +<% values['methods'].each do |method| %> +  <li><%= href method['aref'], method['name'] %></li> +<% end %>    </ul> -ENDIF:methods +<% end %> -IF:includes +<% if values['includes'] %>  <div class="sectiontitle">Included Modules</div>  <ul> -START:includes -  <li>HREF:aref:name:</li> -END:includes +<% values['includes'].each do |include| %> +  <li><%= href include['aref'], include['name'] %>:</li> +<% end %>  </ul> -ENDIF:includes +<% end %> -START:sections -IF:sectitle -<div class="sectiontitle"><a name="%secsequence%">%sectitle%</a></div> -IF:seccomment +<% values['sections'].each do |section| %> +<% if section['sectitle'] %> +<div class="sectiontitle"><a name="<%= section['secsequence'] %>"><%= section['sectitle'] %></a></div> +<% if section['seccomment'] %>  <div class="description"> -%seccomment% +<%= section['seccomment'] %>  </div> -ENDIF:seccomment -ENDIF:sectitle +<% end %> +<% end %> -IF:classlist +<% if section['classlist'] %>    <div class="sectiontitle">Classes and Modules</div> -  %classlist% -ENDIF:classlist +  <%= section['classlist'] %> +<% end %> -IF:constants +<% if section['constants'] %>    <div class="sectiontitle">Constants</div>    <table border='0' cellpadding='5'> -START:constants +<% section['constants'].each do |constant| %>    <tr valign='top'> -    <td class="attr-name">%name%</td> +    <td class="attr-name"><%= constant['name'] %></td>      <td>=</td> -    <td class="attr-value">%value%</td> +    <td class="attr-value"><%= constant['value'] %></td>    </tr> -IF:desc +<% if constant['desc'] %>    <tr valign='top'>      <td> </td> -    <td colspan="2" class="attr-desc">%desc%</td> +    <td colspan="2" class="attr-desc"><%= constant['desc'] %></td>    </tr> -ENDIF:desc -END:constants +<% end %> +<% end %>    </table> -ENDIF:constants +<% end %> -IF:attributes +<% if section['attributes'] %>    <div class="sectiontitle">Attributes</div>    <table border='0' cellpadding='5'> -START:attributes +<% section['attributes'].each do |attribute| %>    <tr valign='top'>      <td class='attr-rw'> -IF:rw -[%rw%] -ENDIF:rw +<% if attribute['rw'] %> +[<%= attribute['rw'] %>] +<% end %>      </td> -    <td class='attr-name'>%name%</td> -    <td class='attr-desc'>%a_desc%</td> +    <td class='attr-name'><%= attribute['name'] %></td> +    <td class='attr-desc'><%= attribute['a_desc'] %></td>    </tr> -END:attributes +<% end %>    </table> -ENDIF:attributes +<% end %> -IF:method_list -START:method_list -IF:methods -<div class="sectiontitle">%type% %category% methods</div> -START:methods +<% if section['method_list'] %> +<% section['method_list'].each do |method_list| %> +<% if method_list['methods'] %> +<div class="sectiontitle"><%= method_list['type'] %> <%= method_list['category'] %> methods</div> +<% method_list['methods'].each do |method| %>  <div class="method">    <div class="title"> -IF:callseq -    <a name="%aref%"></a><b>%callseq%</b> -ENDIF:callseq -IFNOT:callseq -    <a name="%aref%"></a><b>%name%</b>%params% -ENDIF:callseq -IF:codeurl -[ <a href="%codeurl%" target="SOURCE_CODE" onclick="javascript:openCode('%codeurl%'); return false;">source</a> ] -ENDIF:codeurl +<% if method['callseq'] %> +    <a name="<%= method['aref'] %>"></a><b><%= method['callseq'] %></b> +<% end %> +<% unless method['callseq'] %> +    <a name="<%= method['aref'] %>"></a><b><%= method['name'] %></b><%= method['params'] %> +<% end %> +<% if method['codeurl'] %> +[ <a href="<%= method['codeurl'] %>" target="SOURCE_CODE" onclick="javascript:openCode('<%= method['codeurl'] %>'); return false;">source</a> ] +<% end %>    </div> -IF:m_desc +<% if method['m_desc'] %>    <div class="description"> -  %m_desc% +  <%= method['m_desc'] %>    </div> -ENDIF:m_desc -IF:aka +<% end %> +<% if method['aka'] %>  <div class="aka">    This method is also aliased as -START:aka -  <a href="%aref%">%name%</a> -END:aka +<% method['aka'].each do |aka| %> +  <a href="<%= aka['aref'] %>"><%= aka['name'] %></a> +<% end %>  </div> -ENDIF:aka -IF:sourcecode +<% end %> +<% if method['sourcecode'] %>  <div class="sourcecode"> -  <p class="source-link">[ <a href="javascript:toggleSource('%aref%_source')" id="l_%aref%_source">show source</a> ]</p> -  <div id="%aref%_source" class="dyn-source"> +  <p class="source-link">[ <a href="javascript:toggleSource('<%= method['aref'] %>_source')" id="l_<%= method['aref'] %>_source">show source</a> ]</p> +  <div id="<%= method['aref'] %>_source" class="dyn-source">  <pre> -%sourcecode% +<%= method['sourcecode'] %>  </pre>    </div>  </div> -ENDIF:sourcecode +<% end %>  </div> -END:methods -ENDIF:methods -END:method_list -ENDIF:method_list -END:sections +<% end %> +<% end %> +<% end %> +<% end %> +<% end %>  </div>  HTML @@ -489,7 +493,7 @@ FOOTER = <<ENDFOOTER  ENDFOOTER  BODY = HEADER + <<ENDBODY -  !INCLUDE! <!-- banner header --> +  <%= template_include %> <!-- banner header -->    <div id="bodyContent">      #{METHOD_LIST} @@ -502,8 +506,8 @@ ENDBODY  SRC_PAGE = XHTML_PREAMBLE + <<HTML  <html> -<head><title>%title%</title> -<meta http-equiv="Content-Type" content="text/html; charset=%charset%" /> +<head><title><%= values['title'] %></title> +<meta http-equiv="Content-Type" content="text/html; charset=<%= values['charset'] %>" />  <style type="text/css">  .ruby-comment    { color: green; font-style: italic }  .ruby-constant   { color: #4433aa; font-weight: bold; } @@ -521,7 +525,7 @@ SRC_PAGE = XHTML_PREAMBLE + <<HTML  </style>  </head>  <body bgcolor="white"> -<pre>%code%</pre> +<pre><%= values['code'] %></pre>  </body>  </html>  HTML @@ -529,13 +533,13 @@ HTML  ########################## Index ################################  FR_INDEX_BODY = <<HTML -!INCLUDE! +<%= template_include %>  HTML  FILE_INDEX = XHTML_PREAMBLE + <<HTML  <html>  <head> -<meta http-equiv="Content-Type" content="text/html; charset=%charset%" /> +<meta http-equiv="Content-Type" content="text/html; charset=<%= values['charset'] %>" />  <title>Index</title>  <style type="text/css">  <!-- @@ -571,11 +575,11 @@ FILE_INDEX = XHTML_PREAMBLE + <<HTML  <base target="docwin" />  </head>  <body> -<div class="banner">%list_title%</div> +<div class="banner"><%= values['list_title'] %></div>  <div class="entries"> -START:entries -<a href="%href%">%name%</a><br /> -END:entries +<% values['entries'].each do |entrie| %> +<a href="<%= entrie['href'] %>"><%= entrie['name'] %></a><br /> +<% end %>  </div>  </body></html>  HTML @@ -586,8 +590,8 @@ METHOD_INDEX = FILE_INDEX  INDEX = XHTML_FRAMESET_PREAMBLE + <<HTML  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  <head> -  <title>%title%</title> -  <meta http-equiv="Content-Type" content="text/html; charset=%charset%" /> +  <title><%= values['title'] %></title> +  <meta http-equiv="Content-Type" content="text/html; charset=<%= values['charset'] %>" />  </head>  <frameset cols="20%,*"> @@ -596,7 +600,7 @@ INDEX = XHTML_FRAMESET_PREAMBLE + <<HTML          <frame src="fr_class_index.html"  name="Classes" />          <frame src="fr_method_index.html" name="Methods" />      </frameset> -    <frame  src="%initial_page%" name="docwin" /> +    <frame  src="<%= values['initial_page'] %>" name="docwin" />      <noframes>            <body bgcolor="white">              Click <a href="html/index.html">here</a> for a non-frames @@ -610,4 +614,5 @@ HTML  end  end - +end +end diff --git a/railties/Rakefile b/railties/Rakefile index efdb31cbd8..bf19961b59 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -1,3 +1,5 @@ +gem 'rdoc', '= 2.2' +require 'rdoc'  require 'rake'  require 'rake/testtask'  require 'rake/rdoctask' | 
