aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/rdoc/parsers/parse_rb.rb8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 05ae770455..fd6cdd003b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jun 21 15:57:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/rdoc/parsers/parse_rb.rb (RDoc#collect_first_comment): skip
+ magic comment.
+
Sat Jun 21 15:54:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: check if fork works with pthread.
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