summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-21 06:57:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-21 06:57:28 +0000
commit47f5c15e8d6a6c78703b363e9fd351ac44b616e1 (patch)
tree6a77af68de8f4d30cb8023910b7f3591a6eb0d8e /lib
parent3d9c550bf91da943f196e71c821953c20ca601dd (diff)
* lib/rdoc/parsers/parse_rb.rb (RDoc#collect_first_comment): skip
magic comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/parsers/parse_rb.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb
index 5e223bf779..a68094152c 100644
--- a/lib/rdoc/parsers/parse_rb.rb
+++ b/lib/rdoc/parsers/parse_rb.rb
@@ -1536,10 +1536,15 @@ class RDoc::RubyParser
tk = get_tk
while tk.kind_of?(TkCOMMENT)
- if first_line && tk.text[0,2] == "#!"
+ if first_line && /\A#!/ =~ tk.text
+ skip_tkspace
+ tk = get_tk
+ elsif first_line && /\A#\s*-\*-/ =~ tk.text
+ first_line = false
skip_tkspace
tk = get_tk
else
+ first_line = false
res << tk.text << "\n"
tk = get_tk
if tk.kind_of? TkNL
@@ -1547,7 +1552,6 @@ class RDoc::RubyParser
tk = get_tk
end
end
- first_line = false
end
unget_tk(tk)
res