Giuseppe Bilotta <giuseppe.bilotta@xxxxxxxxx> writes: > 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@xxxxxxxxx> > --- > diff.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/diff.c b/diff.c > index cbf2547..c253015 100644 > --- 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) Thanks. I do not talk Ruby, so I'll wait for a few days to hear any one of the following happen before deciding what to do with this patch: (1) Yeah, this is a sufficient and necessary set of keywords, and it would make my Ruby life so much better; (2) This might be a good start but you need to cover this and that keywords as well; (3) This will misidentify a line that is not the beginning of a definition, and should not be applied; Needless to say, "Here is a better patch" is appreciated if somebody says (2) or (3). -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html