From 455b051a008aa859a7b0d6fca56de69a38cc1f8d Mon Sep 17 00:00:00 2001 From: drbrain Date: Sun, 10 Feb 2008 03:59:08 +0000 Subject: * 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 --- lib/rdoc/code_objects.rb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'lib/rdoc/code_objects.rb') diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb index dfc0fff9cc..da383d69c4 100644 --- a/lib/rdoc/code_objects.rb +++ b/lib/rdoc/code_objects.rb @@ -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 -- cgit v1.2.3