Simon Vandemoortele wrote:
> On Wed, 23 Apr 2003 17:42:51 +0900, Harry Ohlsen <harryo / qiqsolutions.com> wrote:
> 
> I'd like to evolve this little piece of code as a community; is there
> anywhere I can post the code so that everyone can add his contribution ?

There was another post where someone has put it on the Wiki, so that's sorted now.

However, not knowing anything about how to use a Wiki properly yet ... I promise to read all about it on the weekend :-) ... I'll post a small patch here, that hopefully someone else can apply.

There's a minor issue if you try to get a complete class listing, by doing "classtree(Object)", because Object.superclass is nil.  Here's the original code:

      methods = (current_root.instance_methods - current_root.superclass.instance_methods).sort

and here's my trivial change:

      methods = current_root.instance_methods

      if current_root.superclass
        methods -= current_root.superclass.instance_methods
      end

      methods.sort!

> PS: I've added printing of class methods.

Yes, very nice!  I've just printed out a complete class tree, with methods, to read on the train home.

Cheers,

Harry O.