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/code_object.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/rdoc/code_object.rb') diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb index 63f86afc64..606fd8ff49 100644 --- a/lib/rdoc/code_object.rb +++ b/lib/rdoc/code_object.rb @@ -130,7 +130,8 @@ class RDoc::CodeObject # TODO is this sufficient? # HACK correct fix is to have #initialize create @comment # with the correct encoding - if Object.const_defined? :Encoding and @comment.empty? then + if String === @comment and + Object.const_defined? :Encoding and @comment.empty? then @comment.force_encoding comment.encoding end @comment @@ -194,6 +195,12 @@ class RDoc::CodeObject self end + def file_name + return unless @file + + @file.absolute_name + end + ## # Force the documentation of this object unless documentation # has been turned off by :endoc: -- cgit v1.2.3