From 47f5c15e8d6a6c78703b363e9fd351ac44b616e1 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 21 Jun 2008 06:57:28 +0000 Subject: * 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 --- ChangeLog | 5 +++++ lib/rdoc/parsers/parse_rb.rb | 8 ++++++-- 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 + + * lib/rdoc/parsers/parse_rb.rb (RDoc#collect_first_comment): skip + magic comment. + Sat Jun 21 15:54:55 2008 Nobuyoshi Nakada * 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 -- cgit v1.2.3