From: Kevin Ballard Date: Sat, 02 Aug 2008 05:47:20 GMT Subject: Re: [PATCH] diff: add ruby funcname pattern Message-ID: In-Reply-To: On Aug 1, 2008, at 10:41 PM, Giuseppe Bilotta wrote: > On Sat, Aug 2, 2008 at 2:31 AM, Kevin Ballard wrote: >> >> As a Ruby user, the regex for the funcname looks fine to me. > > What is your opinion about the anonymous code blocks? > > I've been thinking that another possibility could be to have two ruby > funcnames, a simpler one (the one I presented) that only has 'named' > blocks, and a more thorough one that also matches up anonymous blocks. > User could then choose which one to use in their code by having > gitattributes such as *.rb diff=ruby or *.rb diff=ruby-full (or > whatever else). > > I'm not sure this would be a sensible policy though. If you're going to get into anonymous code blocks, you're going to have a really tough time deciding which blocks are interesting and which aren't. And as you stated before, without a stack-based approach, this could really fall apart, as anonymous blocks are (almost) always going to be inside a method. I think it's far simpler to stick with class/module/def. -Kevin Ballard -- Kevin Ballard http://kevin.sb.org kevin@sb.org http://www.tildesoft.com