moose/namespace-autoclean — pull request #1 by haarg (2014-01-07 12:16:53+00:00)
Title: Don't require Moose

Instead of always creating a Class::MOP metaclass to get a method list, fall back on using a heuristic based on the sub name. This should match what Class::MOP does for most cases, but will play better with Moo classes.

One exception is Moo roles that are composed at compile time: BEGIN { with 'Some::Role'; } The existing code would force inflation of a Moose metaclass, which would have an accurate list of all the methods from both the class and the role. With this branch, it won't recognize the role's methods as part of the class and will clear them out. The only solution for this I can think of is to poke into Moo's internals slightly.

The documentation could probably use some more work too.

This probably isn't ready for merge quite yet, but opening for discussion.