diff options
Diffstat (limited to 'lib/rdoc/code_object.rb')
-rw-r--r-- | lib/rdoc/code_object.rb | 9 |
1 files changed, 8 insertions, 1 deletions
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: |