mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc/code_objects.rb: Make some attributes accessible for reuse.
* lib/rdoc/generator/html.rb: Pull out ContextUser classes and related methods for reuse. * lib/rdoc/generator.rb: Move ContextUser classes to RDoc::Generator::Context for reuse. * lib/rdoc/rdoc.rb: Make RDoc::RDoc initialization a little easier. * lib/rdoc/options.rb: Make RDoc::Options easier to use without parsing an ARGV. * lib/rdoc/markup/to_*.rb: Subclass RDoc::Markup::Formatter. * lib/rdoc/markup/formatter.rb: Add RDoc::Markup::Formatter to make RDoc markup conversion easier. * lib/rdoc/markup/fragments.rb: Make RDoc::Markup::ListItem easier to test. * lib/rdoc/markup/to_html_hyperlink.rb: Pulled out of the HTML generator for easier reusability. * lib/rdoc/markup.rb: Fix bug with labeled lists containing bullet lists. * lib/rdoc/generators/html/html.rb: Fix Constant display. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d44f24c47c
commit
455b051a00
21 changed files with 1839 additions and 1588 deletions
|
@ -5,10 +5,10 @@ require 'rdoc/tokenstream'
|
|||
|
||||
module RDoc
|
||||
|
||||
|
||||
##
|
||||
# We contain the common stuff for contexts (which are containers)
|
||||
# and other elements (methods, attributes and so on)
|
||||
#
|
||||
|
||||
class CodeObject
|
||||
|
||||
attr_accessor :parent
|
||||
|
@ -82,8 +82,7 @@ module RDoc
|
|||
# Access the code object's comment
|
||||
attr_reader :comment
|
||||
|
||||
# Update the comment, but don't overwrite a real comment
|
||||
# with an empty one
|
||||
# Update the comment, but don't overwrite a real comment with an empty one
|
||||
def comment=(comment)
|
||||
@comment = comment unless comment.empty?
|
||||
end
|
||||
|
@ -94,7 +93,7 @@ module RDoc
|
|||
# those directives. Wehn a comment is assigned, we then extract
|
||||
# out any matching directives and update our object
|
||||
|
||||
def CodeObject.attr_overridable(name, *aliases)
|
||||
def self.attr_overridable(name, *aliases)
|
||||
@overridables ||= {}
|
||||
|
||||
attr_accessor name
|
||||
|
@ -623,7 +622,7 @@ module RDoc
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
##
|
||||
# AnyMethod is the base class for objects representing methods
|
||||
|
||||
class AnyMethod < CodeObject
|
||||
|
@ -632,14 +631,18 @@ module RDoc
|
|||
attr_accessor :block_params
|
||||
attr_accessor :dont_rename_initialize
|
||||
attr_accessor :singleton
|
||||
attr_reader :aliases # list of other names for this method
|
||||
attr_accessor :is_alias_for # or a method we're aliasing
|
||||
attr_reader :text
|
||||
|
||||
# list of other names for this method
|
||||
attr_reader :aliases
|
||||
|
||||
# method we're aliasing
|
||||
attr_accessor :is_alias_for
|
||||
|
||||
attr_overridable :params, :param, :parameters, :parameter
|
||||
|
||||
attr_accessor :call_seq
|
||||
|
||||
|
||||
include TokenStream
|
||||
|
||||
def initialize(text, name)
|
||||
|
@ -693,7 +696,6 @@ $stderr.puts p
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
# Represent an alias, which is an old_name/ new_name pair associated
|
||||
# with a particular context
|
||||
class Alias < CodeObject
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue