diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-10 06:36:13 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-10 06:36:13 +0000 |
commit | 1325437297539bf433904b64db63a3186e62177e (patch) | |
tree | 01608a107ec3939b1013152d961b6407a5ba9c25 /lib/rdoc/parser/simple.rb | |
parent | ce2b574017cacc2c3f2b0e92f82a7f250639fc34 (diff) | |
download | ruby-1325437297539bf433904b64db63a3186e62177e.tar.gz |
* lib/rdoc: Import RDoc 2.5.2
* lib/rdoc/parser/ruby.rb (RDoc::Parser::Ruby): Don't parse rdoc
files, reverts r24976 in favor of include directive support in C
parser.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser/simple.rb')
-rw-r--r-- | lib/rdoc/parser/simple.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rdoc/parser/simple.rb b/lib/rdoc/parser/simple.rb index 9072667f89..37125ff299 100644 --- a/lib/rdoc/parser/simple.rb +++ b/lib/rdoc/parser/simple.rb @@ -24,7 +24,10 @@ class RDoc::Parser::Simple < RDoc::Parser # Extract the file contents and attach them to the TopLevel as a comment def scan - @top_level.comment = remove_private_comments(@content) + comment = remove_coding_comment @content + comment = remove_private_comments comment + + @top_level.comment = comment @top_level.parser = self.class @top_level end @@ -33,5 +36,9 @@ class RDoc::Parser::Simple < RDoc::Parser comment.gsub(/^--\n.*?^\+\+/m, '').sub(/^--\n.*/m, '') end + def remove_coding_comment text + text.sub(/\A# .*coding[=:].*$/, '') + end + end |