From: "Brian Schröder" Date: 2004-11-13T19:11:44+09:00 Subject: Re: Trivial trick for looking at complex code On Sat, 13 Nov 2004 08:30:44 +0900 Hal Fulton wrote: > I was looking at some really complex code today (someone else's) and > felt a need to see its structure a little better. > > You'd be surprised how helpful this is: > > grep -E "^ *(class|module|attr|def)" file.rb > > It shows fairly clearly all the hierarchies, the method signatures, > and the attributes. > > That's making certain assumptions about common coding style. > > Below is an example of running it against cgi.rb... > > OK, it's not rocket science, but I felt like sharing it. Another method I use is rdoc -a -S -N -d This gives a really nice overview, but has the drawback of requiring a browser. Regards, Brian -- Brian Schr�der http://www.brian-schroeder.de/