summaryrefslogtreecommitdiff
path: root/lib/rdoc/code_objects.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-10 03:59:08 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-10 03:59:08 +0000
commit455b051a008aa859a7b0d6fca56de69a38cc1f8d (patch)
treed6669b04050c3ac4281651be447dd7d5f57463ea /lib/rdoc/code_objects.rb
parentd44f24c47cc0d03135fabb7c764ab23e9d5d1152 (diff)
* 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
Diffstat (limited to 'lib/rdoc/code_objects.rb')
-rw-r--r--lib/rdoc/code_objects.rb22
1 files changed, 12 insertions, 10 deletions
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