From: Paul Brannan Date: 2001-12-12T07:43:29+09:00 Subject: [ruby-talk:28283] Re: rdefs : a puny doc tool On Wed, Dec 12, 2001 at 07:01:19AM +0900, Joel VanderWerf wrote: > Issac Trotts wrote: > > > > # print out a brief summary of a ruby file. > > > > while gets > > print if /(def|class|module)/ > > end > > Not bad. A slight improvement: > print if /^\s*(def|class|module)/ I like the first one better, since it lets me do this: # class| Class Foo is a very useful class. I like to use it a lot. It # class| does very cool and interesting things, and it makes me very # class| happy. class Foo # def| The initialize method is used to initialize a Foo object. It # def| is a very fun and exciting method to call. It can take any # def| number of arguments. def initialize(*args) # do something end # def| The foo method is also very fun, but not very interesting. It # def| is a very boring method, and does not play well with others. def foo return nil end end Paul