From: Jamis Buck Date: 2004-11-13T08:39:34+09:00 Subject: Re: Trivial trick for looking at complex code 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. Very slick, Hal! I just ran it through my Net::SSH stuff. Handy. :) Definately something to remember. Thanks for sharing. :) - Jamis -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis