From: Curt Hibbs Date: 2004-11-13T13:54:54+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. I can't claim that this is as simple as your technique, but you could also open the files in FreeRIDE. The navigation pane gives you the same info in a collapsible tree, plus if you click on any entry (module, class, or method), the edit pane is scrolled to that spot in the code and displayed with full syntax highlighting. Curt