Le mercredi 25 juillet 2007 22:58 +0900, Robert Dober a ˝─rit :
> > You're right, but it can be fixed :)
> no it cannot :(, look at C4 below
> > ---
> > class Class
> >   def included_modules
> >     c = self
> >     all = c.ancestors - [c]
> >     bad = all.map {|a|
> >       a.ancestors - [a]
> >     }
> >     # Module#superclass doesn't exist
> >     bad << c.superclass if c.is_a? Class
> >     all - bad.flatten
> >   end
> > end
> >
> > module M1; end
> > module M2; include M1; end
> > module M3; end
> > module M4; include M3; end
> > module M5; end
> > module M6; include M5; end
> > module M7; end
> > class C1; include M2; end
> > class C2<C1; include M4; end
> > class C3<C2; include M6; include M7; end
> class C4<C2; include M5; include M6; end
> *************************************
> M5 will not show up.

This was the first and not fixable (with this solution) problem :)
module re-included are hidden

---
module M1; end
module M2; end
module M3; include M2; end
class C1; include M1; end
class C2 < C1; include M1; include M2; include M3; end
---
only [M3] will show up

too bad...

--
Etienne Vallette d'Osia