[Catalyst-dev] CataMoose & C::Model::Adaptor do not play nice? (try 2)

Tomas Doran bobtfish at bobtfish.net
Sat May 24 10:52:58 GMT 2008


I tried to post this on the 20th, but it dropped into the mod queue  
for being too big as I attached my demo app, and never appeared..  
Repost without the attachment...

Catalyst::Model::Adaptor and CataMoose don't play too well together  
(i.e. not at all currently).

This is something to do with C::M::A's use of Class::C3's  
next::method stuff (I think), and happens in the COMPONENT method of  
Catalyst::Component, but I haven't really got any further to  
debugging this than that.

How I produced a test case below:

$ cd Catamoose
$ script/catalyst.pl TestApp
$ cat > TestApp/lib/ExternalModel.pm
package ExternalModel;
use Moose;

has thingie => ( is => 'rw', isa => 'Str' );

1;
$ cat > TestApp/lib/TestApp/Model/External.pm
package TestApp::Model::External;
use base 'Catalyst::Model::Adaptor';
__PACKAGE__->config( class => 'ExternalModel' );

1;

$ perl -Ilib -ITestApp/lib TestApp/script/testapp_server.pl -p 3005 #  
I'm in the catmoose checkout, so -Ilib gives me catmoose..
Couldn't instantiate component "TestApp::Model::External", "need  
class at lib/Catalyst.pm line 1927" at TestApp/script/ 
testapp_server.pl line 53
Compilation failed in require at TestApp/script/testapp_server.pl  
line 53.

$ perl -ITestApp/lib TestApp/script/testapp_server.pl -p 3005 # No - 
Ilib, so I get my ~/perl copy of catalyst..
[debug] Debug messages enabled
[debug] Statistics enabled
etc.etc.etc

So it falls on it's ass in the Moose branch, but works with normal  
Catalyst.

I've tarred up the TestApp that I built and it's here: http:// 
bobtfish.net/TestApp.tgz

 From irc / list reading I'm aware that there are woes with things  
using Class::C3 etc - hope this helps someone make a test for  
the ::Compat stuff. I'd like to start testing my apps against the  
moose branch - but that is going to be a nonevent till this get  
sorted in some way.. ;)

Cheers
t0m




More information about the Catalyst-dev mailing list