From b7528b5edb1f9148ea00ebb6151720e5943b3f0b Mon Sep 17 00:00:00 2001 From: drbrain Date: Thu, 16 Jun 2011 04:59:24 +0000 Subject: * lib/rdoc.rb: Import RDoc 3.7 release candidate git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/attr.rb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib/rdoc/attr.rb') diff --git a/lib/rdoc/attr.rb b/lib/rdoc/attr.rb index f04fe168b1..5d9bc17831 100644 --- a/lib/rdoc/attr.rb +++ b/lib/rdoc/attr.rb @@ -6,7 +6,7 @@ require 'rdoc/method_attr' class RDoc::Attr < RDoc::MethodAttr - MARSHAL_VERSION = 1 # :nodoc: + MARSHAL_VERSION = 2 # :nodoc: ## # Is the attribute readable ('R'), writable ('W') or both ('RW')? @@ -92,6 +92,7 @@ class RDoc::Attr < RDoc::MethodAttr @visibility, parse(@comment), singleton, + @file.absolute_name, ] end @@ -103,6 +104,7 @@ class RDoc::Attr < RDoc::MethodAttr # * #parent_name def marshal_load array + version = array[0] @name = array[1] @full_name = array[2] @rw = array[3] @@ -110,9 +112,22 @@ class RDoc::Attr < RDoc::MethodAttr @comment = array[5] @singleton = array[6] || false # MARSHAL_VERSION == 0 + @file = RDoc::TopLevel.new array[7] if version > 1 + @parent_name = @full_name end + def pretty_print q # :nodoc: + q.group 2, "[#{self.class.name} #{full_name} #{rw} #{visibility}", "]" do + unless comment.empty? then + q.breakable + q.text "comment:" + q.breakable + q.pp @comment + end + end + end + def to_s # :nodoc: "#{definition} #{name} in: #{parent}" end -- cgit v1.2.3