Skip to content

Commit

Permalink
diff: add ruby funcname pattern
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Giuseppe Bilotta authored and Junio C Hamano committed Aug 2, 2008
1 parent 5cbef01 commit ad8c1d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ad8c1d9

Please sign in to comment.