diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb index 37dcadd3d7..1460433b1f 100644 --- a/lib/rdoc/code_object.rb +++ b/lib/rdoc/code_object.rb @@ -90,13 +90,6 @@ class RDoc::CodeObject attr_reader :store - ## - # We are the model of the code, but we know that at some point we will be - # worked on by viewers. By implementing the Viewable protocol, viewers can - # associated themselves with these objects. - - attr_accessor :viewer - ## # When mixed-in to a class, this points to the Context in which it was originally defined. @@ -217,20 +210,6 @@ def done_documenting=(value) @document_children = @document_self end - ## - # Yields each parent of this CodeObject. See also - # RDoc::ClassModule#each_ancestor - - def each_parent - code_object = self - - while code_object = code_object.parent do - yield code_object - end - - self - end - ## # File name where this CodeObject was found. # @@ -327,13 +306,6 @@ def parent end end - ## - # File name of our parent - - def parent_file_name - @parent ? @parent.base_name : '(unknown)' - end - ## # Name of our parent diff --git a/lib/rdoc/code_object/alias.rb b/lib/rdoc/code_object/alias.rb index b76f0ad7e8..bd5b3ec6b5 100644 --- a/lib/rdoc/code_object/alias.rb +++ b/lib/rdoc/code_object/alias.rb @@ -59,13 +59,6 @@ def aref "#alias-#{type}-#{html_name}" end - ## - # Full old name including namespace - - def full_old_name - @full_name || "#{parent.name}#{pretty_old_name}" - end - ## # HTML id-friendly version of +#new_name+. diff --git a/lib/rdoc/code_object/class_module.rb b/lib/rdoc/code_object/class_module.rb index e171c86f02..98c486418a 100644 --- a/lib/rdoc/code_object/class_module.rb +++ b/lib/rdoc/code_object/class_module.rb @@ -34,8 +34,6 @@ class RDoc::ClassModule < RDoc::Context attr_accessor :comment_location - attr_accessor :diagram # :nodoc: - ## # Class or module this constant is an alias for @@ -56,7 +54,6 @@ def self.from_module class_type, mod klass.parent = mod.parent klass.section = mod.section - klass.viewer = mod.viewer klass.attributes.concat mod.attributes klass.method_list.concat mod.method_list @@ -110,7 +107,6 @@ def self.from_module class_type, mod def initialize(name, superclass = nil) @constant_aliases = [] - @diagram = nil @is_alias_for = nil @name = name @superclass = superclass diff --git a/lib/rdoc/code_object/context.rb b/lib/rdoc/code_object/context.rb index 2d2c5f90c8..49830036eb 100644 --- a/lib/rdoc/code_object/context.rb +++ b/lib/rdoc/code_object/context.rb @@ -688,13 +688,6 @@ def current_section section end - ## - # Is part of this thing was defined in +file+? - - def defined_in?(file) - @in_files.include?(file) - end - def display(method_attr) # :nodoc: if method_attr.is_a? RDoc::Attr "#{method_attr.definition} #{method_attr.pretty_name}" @@ -713,13 +706,6 @@ def display(method_attr) # :nodoc: def each_ancestor(&_) # :nodoc: end - ## - # Iterator for attributes - - def each_attribute # :yields: attribute - @attributes.each { |a| yield a } - end - ## # Iterator for classes and modules @@ -727,27 +713,6 @@ def each_classmodule(&block) # :yields: module classes_and_modules.sort.each(&block) end - ## - # Iterator for constants - - def each_constant # :yields: constant - @constants.each {|c| yield c} - end - - ## - # Iterator for included modules - - def each_include # :yields: include - @includes.each do |i| yield i end - end - - ## - # Iterator for extension modules - - def each_extend # :yields: extend - @extends.each do |e| yield e end - end - ## # Iterator for methods @@ -847,13 +812,6 @@ def find_external_alias_named(name) end end - ## - # Finds a file with +name+ in this context - - def find_file_named name - @store.find_file_named name - end - ## # Finds an instance method with +name+ in this context @@ -871,7 +829,7 @@ def find_local_symbol(symbol) find_attribute_named(symbol) or find_external_alias_named(symbol) or find_module_named(symbol) or - find_file_named(symbol) + @store.find_file_named(symbol) end ## diff --git a/lib/rdoc/code_object/method_attr.rb b/lib/rdoc/code_object/method_attr.rb index 144aeba9c1..a59f542edc 100644 --- a/lib/rdoc/code_object/method_attr.rb +++ b/lib/rdoc/code_object/method_attr.rb @@ -313,19 +313,6 @@ def name_prefix @singleton ? '::' : '#' end - ## - # Name for output to HTML. For class methods the full name with a "." is - # used like +SomeClass.method_name+. For instance methods the class name is - # used if +context+ does not match the parent. - # - # This is to help prevent people from using :: to call class methods. - - def output_name context - return "#{name_prefix}#{@name}" if context == parent - - "#{parent_name}#{@singleton ? '.' : '#'}#{@name}" - end - ## # Method/attribute name with class/instance indicator diff --git a/lib/rdoc/code_object/require.rb b/lib/rdoc/code_object/require.rb index 05e26b84b0..f47e3b1534 100644 --- a/lib/rdoc/code_object/require.rb +++ b/lib/rdoc/code_object/require.rb @@ -24,7 +24,7 @@ def inspect # :nodoc: self.class, object_id, @name, - parent_file_name, + @parent ? @parent.base_name : '(unknown)' ] end diff --git a/lib/rdoc/code_object/top_level.rb b/lib/rdoc/code_object/top_level.rb index b97ca7deb3..c567fec996 100644 --- a/lib/rdoc/code_object/top_level.rb +++ b/lib/rdoc/code_object/top_level.rb @@ -6,11 +6,6 @@ class RDoc::TopLevel < RDoc::Context MARSHAL_VERSION = 0 # :nodoc: - ## - # This TopLevel's File::Stat struct - - attr_accessor :file_stat - ## # Relative name of this file @@ -28,8 +23,6 @@ class RDoc::TopLevel < RDoc::Context attr_reader :classes_or_modules - attr_accessor :diagram # :nodoc: - ## # The parser class that processed this file @@ -45,8 +38,6 @@ def initialize absolute_name, relative_name = absolute_name @name = nil @absolute_name = absolute_name @relative_name = relative_name - @file_stat = File.stat(absolute_name) rescue nil # HACK for testing - @diagram = nil @parser = nil @classes_or_modules = [] @@ -186,13 +177,6 @@ def inspect # :nodoc: ] end - ## - # Time this file was last modified, if known - - def last_modified - @file_stat ? file_stat.mtime : nil - end - ## # Dumps this TopLevel for use by ri. See also #marshal_load @@ -213,8 +197,6 @@ def marshal_load array # :nodoc: @parser = array[2] @comment = RDoc::Comment.from_document array[3] - - @file_stat = nil end ## diff --git a/lib/rdoc/generator/pot/message_extractor.rb b/lib/rdoc/generator/pot/message_extractor.rb index 4938858bdc..463132929f 100644 --- a/lib/rdoc/generator/pot/message_extractor.rb +++ b/lib/rdoc/generator/pot/message_extractor.rb @@ -35,11 +35,11 @@ def extract_from_klass klass end end - klass.each_constant do |constant| + klass.constants.each do |constant| extract_text(constant.comment, constant.full_name) end - klass.each_attribute do |attribute| + klass.attributes.each do |attribute| extract_text(attribute.comment, attribute.full_name) end diff --git a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml index 7602076c96..067bd62edd 100644 --- a/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +++ b/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml @@ -3,7 +3,7 @@