lib/rdoc/comment.rb in rdoc-3.12.2 vs lib/rdoc/comment.rb in rdoc-4.0.0.preview2

- old
+ new

@@ -21,10 +21,15 @@ # The RDoc::TopLevel this comment was found in attr_accessor :location ## + # For duck-typing when merging classes at load time + + alias file location # :nodoc: + + ## # The text for this comment attr_reader :text ## @@ -141,10 +146,12 @@ @format = format @document = nil end def inspect # :nodoc: - "#<%s:%x %s %p>" % [self.class, object_id, @location.absolute_name, @text] + location = @location ? @location.relative_name : '(unknown)' + + "#<%s:%x %s %p>" % [self.class, object_id, location, @text] end ## # Normalizes the text. See RDoc::Text#normalize_comment for details