From cc2a16d94d744d14d4a5eb06eca22137f8a9b79e Mon Sep 17 00:00:00 2001 From: drbrain Date: Wed, 2 Feb 2011 00:32:30 +0000 Subject: Import RDoc 3.5.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/code_object.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/rdoc/code_object.rb') diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb index 02b2f2fcf6..3a8adfab67 100644 --- a/lib/rdoc/code_object.rb +++ b/lib/rdoc/code_object.rb @@ -60,11 +60,23 @@ class RDoc::CodeObject attr_reader :force_documentation + ## + # Line in #file where this CodeObject was defined + + attr_accessor :line + ## # Hash of arbitrary metadata for this CodeObject attr_reader :metadata + ## + # Offset in #file where this CodeObject was defined + #-- + # TODO character or byte? + + attr_accessor :offset + ## # Our parent CodeObject @@ -115,6 +127,12 @@ class RDoc::CodeObject if comment and not comment.empty? then normalize_comment comment else + # 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 + @comment.force_encoding comment.encoding + end @comment end end -- cgit v1.2.3