Code

diff: add ruby funcname pattern
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 31 Jul 2008 07:21:48 +0000 (09:21 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 2 Aug 2008 22:38:14 +0000 (15:38 -0700)
Provide a regexp that catches class, module and method definitions in
Ruby scripts, since the built-in default only finds classes.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c

diff --git a/diff.c b/diff.c
index cbf25473c594abfd1fc13473108dc9c15e2f1d15..c253015c5d612a6715485031adc840658ffaf9c0 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1381,6 +1381,7 @@ static struct builtin_funcname_pattern {
                        "[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
                        "[      ]*([^;]*\\)$" },
        { "tex", "^\\(\\\\\\(sub\\)*section{.*\\)$" },
+       { "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
 };
 
 static const char *diff_funcname_pattern(struct diff_filespec *one)