mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Complete RDoc namespace change
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
937b7ab8b5
commit
ec519b9b43
15 changed files with 45 additions and 46 deletions
|
@ -219,7 +219,7 @@ Options are:
|
|||
[<tt>--template</tt> <i>name</i>]
|
||||
specify an alternate template to use when generating output (the
|
||||
default is 'standard'). This template should be in a directory
|
||||
accessible via $: as rdoc/generators/xxxx_template, where 'xxxx'
|
||||
accessible via $: as rdoc/generator/xxxx_template, where 'xxxx'
|
||||
depends on the output formatter.
|
||||
|
||||
[<tt>--version</tt>]
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'rdoc/options'
|
|||
require 'rdoc/markup/simple_markup'
|
||||
require 'rdoc/template'
|
||||
|
||||
module RDoc::Generators
|
||||
module RDoc::Generator
|
||||
|
||||
##
|
||||
# Name of sub-direcory that holds file descriptions
|
|
@ -1,6 +1,6 @@
|
|||
require 'rdoc/generators/html'
|
||||
require 'rdoc/generator/html'
|
||||
|
||||
class RDoc::Generators::CHM < RDoc::Generators::HTML
|
||||
class RDoc::Generator::CHM < RDoc::Generator::HTML
|
||||
|
||||
HHC_PATH = "c:/Program Files/HTML Help Workshop/hhc.exe"
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
require 'rdoc/generators/chm'
|
||||
require 'rdoc/generators/html/html'
|
||||
require 'rdoc/generator/chm'
|
||||
require 'rdoc/generator/html/html'
|
||||
|
||||
module RDoc::Generators::CHM::CHM
|
||||
module RDoc::Generator::CHM::CHM
|
||||
|
||||
HTML = RDoc::Generators::HTML::HTML
|
||||
HTML = RDoc::Generator::HTML::HTML
|
||||
|
||||
INDEX = HTML::INDEX
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
require 'fileutils'
|
||||
|
||||
require 'rdoc/generators'
|
||||
require 'rdoc/generator'
|
||||
require 'rdoc/markup/simple_markup/to_html'
|
||||
|
||||
module RDoc::Generators
|
||||
module RDoc::Generator
|
||||
|
||||
##
|
||||
# Build a hash of all items that can be cross-referenced.
|
||||
|
@ -61,8 +61,8 @@ module RDoc::Generators
|
|||
# (defined in MarkUp). If we fine the corresponding reference,
|
||||
# generate a hyperlink. If the name we're looking for contains
|
||||
# no punctuation, we look for it up the module/class chain. For
|
||||
# example, HyperlinkHtml is found, even without the Generators::
|
||||
# prefix, because we look for it in module Generators first.
|
||||
# example, HyperlinkHtml is found, even without the Generator::
|
||||
# prefix, because we look for it in module Generator first.
|
||||
|
||||
def handle_special_CROSSREF(special)
|
||||
name = special.text
|
||||
|
@ -1168,7 +1168,7 @@ module RDoc::Generators
|
|||
end
|
||||
|
||||
##
|
||||
# Generators may need to return specific subclasses depending on the
|
||||
# Generator may need to return specific subclasses depending on the
|
||||
# options they are passed. Because of this we create them using a factory
|
||||
|
||||
def self.for(options)
|
||||
|
@ -1221,8 +1221,8 @@ module RDoc::Generators
|
|||
template = @options.template
|
||||
|
||||
unless template =~ %r{/|\\} then
|
||||
template = File.join("rdoc/generators",
|
||||
@options.generator.key, template)
|
||||
template = File.join('rdoc', 'generator', @options.generator.key,
|
||||
template)
|
||||
end
|
||||
|
||||
require template
|
|
@ -1,7 +1,7 @@
|
|||
require 'rdoc/generators/html'
|
||||
require 'rdoc/generators/html/html'
|
||||
require 'rdoc/generator/html'
|
||||
require 'rdoc/generator/html/html'
|
||||
|
||||
module RDoc::Generators::HTML::HEFSS
|
||||
module RDoc::Generator::HTML::HEFSS
|
||||
|
||||
FONTS = "Verdana, Arial, Helvetica, sans-serif"
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
require 'rdoc/generators/html'
|
||||
require 'rdoc/generators/html/one_page_html'
|
||||
require 'rdoc/generator/html'
|
||||
require 'rdoc/generator/html/one_page_html'
|
||||
|
||||
##
|
||||
# = CSS2 RDoc HTML template
|
||||
|
@ -21,7 +21,7 @@ require 'rdoc/generators/html/one_page_html'
|
|||
# send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
|
||||
# 94305, USA.
|
||||
|
||||
module RDoc::Generators::HTML::HTML
|
||||
module RDoc::Generator::HTML::HTML
|
||||
|
||||
FONTS = "Verdana,Arial,Helvetica,sans-serif"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
require 'rdoc/generators/html'
|
||||
require 'rdoc/generator/html'
|
||||
|
||||
module RDoc::Generators::HTML::KILMER
|
||||
module RDoc::Generator::HTML::KILMER
|
||||
|
||||
FONTS = "Verdana, Arial, Helvetica, sans-serif"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
require 'rdoc/generators/html'
|
||||
require 'rdoc/generator/html'
|
||||
|
||||
module RDoc::Generators::HTML::ONE_PAGE_HTML
|
||||
module RDoc::Generator::HTML::ONE_PAGE_HTML
|
||||
|
||||
CONTENTS_XML = <<-EOF
|
||||
<% if defined? classes and classes["description"] then %>
|
|
@ -1,4 +1,4 @@
|
|||
require 'rdoc/generators'
|
||||
require 'rdoc/generator'
|
||||
require 'rdoc/markup/simple_markup/to_flow'
|
||||
|
||||
require 'rdoc/ri/cache'
|
||||
|
@ -6,10 +6,10 @@ require 'rdoc/ri/reader'
|
|||
require 'rdoc/ri/writer'
|
||||
require 'rdoc/ri/descriptions'
|
||||
|
||||
class RDoc::Generators::RI
|
||||
class RDoc::Generator::RI
|
||||
|
||||
##
|
||||
# Generators may need to return specific subclasses depending on the
|
||||
# Generator may need to return specific subclasses depending on the
|
||||
# options they are passed. Because of this we create them using a factory
|
||||
|
||||
def self.for(options)
|
||||
|
@ -21,7 +21,7 @@ class RDoc::Generators::RI
|
|||
end
|
||||
|
||||
##
|
||||
# Set up a new RDoc::Generators::RI.
|
||||
# Set up a new RDoc::Generator::RI.
|
||||
|
||||
def initialize(options) #:not-new:
|
||||
@options = options
|
|
@ -1,9 +1,9 @@
|
|||
require 'rdoc/generators/html'
|
||||
require 'rdoc/generator/html'
|
||||
|
||||
##
|
||||
# Generate XML output as one big file
|
||||
|
||||
class RDoc::Generators::XML < RDoc::Generators::HTML
|
||||
class RDoc::Generator::XML < RDoc::Generator::HTML
|
||||
|
||||
##
|
||||
# Standard generator factory
|
||||
|
@ -42,16 +42,16 @@ class RDoc::Generators::XML < RDoc::Generators::HTML
|
|||
|
||||
def build_indices
|
||||
@info.each do |toplevel|
|
||||
@files << RDoc::Generators::HtmlFile.new(toplevel, @options, RDoc::Generators::FILE_DIR)
|
||||
@files << RDoc::Generator::HtmlFile.new(toplevel, @options, RDoc::Generator::FILE_DIR)
|
||||
end
|
||||
|
||||
RDoc::TopLevel.all_classes_and_modules.each do |cls|
|
||||
build_class_list(cls, @files[0], RDoc::Generators::CLASS_DIR)
|
||||
build_class_list(cls, @files[0], RDoc::Generator::CLASS_DIR)
|
||||
end
|
||||
end
|
||||
|
||||
def build_class_list(from, html_file, class_dir)
|
||||
@classes << RDoc::Generators::HtmlClass.new(from, html_file, class_dir, @options)
|
||||
@classes << RDoc::Generator::HtmlClass.new(from, html_file, class_dir, @options)
|
||||
from.each_classmodule do |mod|
|
||||
build_class_list(mod, html_file, class_dir)
|
||||
end
|
||||
|
@ -98,7 +98,7 @@ class RDoc::Generators::XML < RDoc::Generators::HTML
|
|||
end
|
||||
|
||||
def gen_method_index
|
||||
gen_an_index(RDoc::Generators::HtmlMethod.all_methods, 'Methods')
|
||||
gen_an_index(RDoc::Generator::HtmlMethod.all_methods, 'Methods')
|
||||
end
|
||||
|
||||
def gen_an_index(collection, title)
|
|
@ -1,6 +1,6 @@
|
|||
require 'rdoc/generators/xml'
|
||||
require 'rdoc/generator/xml'
|
||||
|
||||
module RDoc::Generators::XML::RDF
|
||||
module RDoc::Generator::XML::RDF
|
||||
|
||||
CONTENTS_RDF = <<-EOF
|
||||
<% if defined? classes and classes["description"] then %>
|
|
@ -1,6 +1,6 @@
|
|||
require 'rdoc/generators/xml'
|
||||
require 'rdoc/generator/xml'
|
||||
|
||||
module RDoc::Generators::XML::XML
|
||||
module RDoc::Generator::XML::XML
|
||||
|
||||
CONTENTS_XML = <<-EOF
|
||||
<% if defined? classes and classes["description"] then %>
|
|
@ -135,7 +135,7 @@ class RDoc::Options
|
|||
##
|
||||
# Template class for file generation
|
||||
#--
|
||||
# HACK around dependencies in lib/rdoc/generators/html.rb
|
||||
# HACK around dependencies in lib/rdoc/generator/html.rb
|
||||
|
||||
attr_accessor :template_class # :nodoc:
|
||||
|
||||
|
|
|
@ -57,21 +57,20 @@ module RDoc
|
|||
Generator = Struct.new(:file_name, :class_name, :key)
|
||||
|
||||
##
|
||||
# This is the list of output generators that we
|
||||
# support
|
||||
# This is the list of output generator that we support
|
||||
|
||||
GENERATORS = {}
|
||||
|
||||
$LOAD_PATH.collect do |d|
|
||||
File.expand_path d
|
||||
end.find_all do |d|
|
||||
File.directory? "#{d}/rdoc/generators"
|
||||
File.directory? "#{d}/rdoc/generator"
|
||||
end.each do |dir|
|
||||
Dir.entries("#{dir}/rdoc/generators").each do |gen|
|
||||
Dir.entries("#{dir}/rdoc/generator").each do |gen|
|
||||
next unless /(\w+)\.rb$/ =~ gen
|
||||
type = $1
|
||||
unless GENERATORS.has_key? type
|
||||
GENERATORS[type] = Generator.new("rdoc/generators/#{gen}",
|
||||
GENERATORS[type] = Generator.new("rdoc/generator/#{gen}",
|
||||
"#{type.upcase}".intern,
|
||||
type)
|
||||
end
|
||||
|
@ -266,7 +265,7 @@ module RDoc
|
|||
|
||||
require gen.file_name
|
||||
|
||||
gen_class = Generators.const_get(gen.class_name)
|
||||
gen_class = ::RDoc::Generator.const_get gen.class_name
|
||||
gen = gen_class.for(options)
|
||||
|
||||
pwd = Dir.pwd
|
||||
|
|
Loading…
Add table
Reference in a new issue