aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/code_object.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
commitb7528b5edb1f9148ea00ebb6151720e5943b3f0b (patch)
tree4caf55c53adb188170240f54b924892fbc5f9814 /lib/rdoc/code_object.rb
parent97ac172d58d695305c39d555155318edb99f1ea7 (diff)
downloadruby-b7528b5edb1f9148ea00ebb6151720e5943b3f0b.tar.gz
* 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
Diffstat (limited to 'lib/rdoc/code_object.rb')
-rw-r--r--lib/rdoc/code_object.rb9
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: