moose/moose — pull request #29 by doy (2013-08-06 19:07:19+00:00)
Title: set the appropriate value in %INC when we create a new class

This should allow us to require a lot less guessing when trying to determine if a class is loaded or not. The kinds of heuristics used by Class::Load and others have caused all kinds of annoying problems over the years, but all of them support checking `%INC` because that check happens in `require`, which they are all based on.

This could cause issues in some edge cases though - @shadowcat-mst brought up this potential problem specifically:
```
2013-08-06 12:26:15 <@mst> actually, I'm willing to bet that it'll break very old school uses of Catalyst::Model::DBIC::Schema
2013-08-06 12:26:31 <@mst> wherein people have a MyApp/Model/DB/Foo.pm
2013-08-06 12:27:02 <@mst> though M::DBIC::Schema may not use ->create
2013-08-06 12:27:11 <@mst> and also, those people are doing it wrong and have been for 5+ years
2013-08-06 12:27:53 <@mst> but there was an old pattern wherein people would scaffold a class
2013-08-06 12:28:07 <@mst> and then do an eval require for it, so a file on disk could add custom methods etc.
2013-08-06 12:28:19 <@mst> that's how pre-Schema::Loader CDBI/DBIC loaders worked
2013-08-06 12:28:44 <@mst> I still regard said pattern as 'doing it wrong', but that doesn't mean people aren't :)
```
so we should see what kinds of potential this has for breakage. I think the benefits will almost certainly still outweigh the potential for brokenness, but we should at least get some kind of an idea of what the scope of that breakage might be (if any).