Skip Menu |
 

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 78852
Status: rejected
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Moose::Cookbook::Meta::Table_MetaclassTrait docs don't use right pathing
Date: Wed, 8 Aug 2012 16:50:30 -0500
To: bugs-moose [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
Download (untitled) / with headers
text/plain 468b
When trying to follow this recipe I got the error Can't locate Moose::Meta::Class::Custom::Trait::Type or Type in @INC I substituted MyApp for my actual app name and had the role named Type with a Type attribute instead of table, but otherwise the code is identical. renaming and moving to Moose::Meta::Custom::Trait::Type resolved the issue MyApp::Meta::Class::Trait::Type does not work (at least without another step ) -- Caleb Cushing http://xenoterracide.com
Download (untitled) / with headers
text/plain 808b
On Wed Aug 08 17:50:46 2012, XENO wrote: Show quoted text
> When trying to follow this recipe I got the error > > Can't locate Moose::Meta::Class::Custom::Trait::Type or Type in @INC > > I substituted MyApp for my actual app name and had the role named Type > with a Type attribute instead of table, but otherwise the code is > identical. renaming and moving to Moose::Meta::Custom::Trait::Type > resolved the issue > > MyApp::Meta::Class::Trait::Type does not work (at least without > another step )
I suspect the problem may be this, from the recipe text: RECIPE CAVEAT This recipe doesn't work when you paste it all into a single file. This is because the use Moose -traits => 'HasTable'; line ends up being executed before the table attribute is defined. When the two packages are separate files, this just works.
Subject: Re: [rt.cpan.org #78852] Moose::Cookbook::Meta::Table_MetaclassTrait docs don't use right pathing
Date: Thu, 9 Aug 2012 16:27:52 -0500
To: bug-Moose [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
Download (untitled) / with headers
text/plain 1.2k
On Wed, Aug 8, 2012 at 4:54 PM, Dave Rolsky via RT <bug-Moose@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=78852 > > > On Wed Aug 08 17:50:46 2012, XENO wrote:
>> When trying to follow this recipe I got the error >> >> Can't locate Moose::Meta::Class::Custom::Trait::Type or Type in @INC >> >> I substituted MyApp for my actual app name and had the role named Type >> with a Type attribute instead of table, but otherwise the code is >> identical. renaming and moving to Moose::Meta::Custom::Trait::Type >> resolved the issue >> >> MyApp::Meta::Class::Trait::Type does not work (at least without >> another step )
> > I suspect the problem may be this, from the recipe text: > > RECIPE CAVEAT > > This recipe doesn't work when you paste it all into a single file. This > is because the use Moose -traits => 'HasTable'; line ends up being executed before the table attribute is defined. > > When the two packages are separate files, this just works.
I had them as separate files, it did not recognize the MyApp prefix, the problem was the namespacing, moose was looking in a certain place for 'HasTable' and it wasn't MyApp. It was Moose::... Custom... Trait -- Caleb Cushing http://xenoterracide.com
Download (untitled) / with headers
text/plain 1.3k
On Thu Aug 09 17:28:02 2012, XENO wrote: Show quoted text
> On Wed, Aug 8, 2012 at 4:54 PM, Dave Rolsky via RT > <bug-Moose@rt.cpan.org> wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=78852 > > > > > On Wed Aug 08 17:50:46 2012, XENO wrote:
> >> When trying to follow this recipe I got the error > >> > >> Can't locate Moose::Meta::Class::Custom::Trait::Type or Type in
> @INC
> >> > >> I substituted MyApp for my actual app name and had the role named
> Type
> >> with a Type attribute instead of table, but otherwise the code is > >> identical. renaming and moving to Moose::Meta::Custom::Trait::Type > >> resolved the issue > >> > >> MyApp::Meta::Class::Trait::Type does not work (at least without > >> another step )
> > > > I suspect the problem may be this, from the recipe text: > > > > RECIPE CAVEAT > > > > This recipe doesn't work when you paste it all into a single file.
> This
> > is because the use Moose -traits => 'HasTable'; line ends up being
> executed before the table attribute is defined.
> > > > When the two packages are separate files, this just works.
> > I had them as separate files, it did not recognize the MyApp prefix, > the problem was the namespacing, moose was looking in a certain place > for 'HasTable' and it wasn't MyApp. It was Moose::... Custom... Trait
Maybe you're missing this bit: Moose::Util::meta_class_alias('HasTable')
Subject: Re: [rt.cpan.org #78852] Moose::Cookbook::Meta::Table_MetaclassTrait docs don't use right pathing
Date: Tue, 18 Sep 2012 00:55:46 -0500
To: bug-Moose [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
Download (untitled) / with headers
text/plain 2.3k
no, I copied and pasted attaching a test tarball, please tell me what I am doing wrong. # run from tarball root prove -lv slave-iv t/test.t .. Can't locate Moose::Meta::Class::Custom::Trait::HasTable or HasTable in @INC (@INC contains: /home/xenoterracide/test/lib /home/xenoterracide/perl5/perlbrew/perls/perl-5.16.1/lib/site_perl/5.16.1/x86_64-linux /home/xenoterracide/perl5/perlbrew/perls/perl-5.16.1/lib/site_perl/5.16.1 /home/xenoterracide/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/x86_64-linux /home/xenoterracide/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1 .). at /home/xenoterracide/test/lib/MyApp/User.pm line 3. BEGIN failed--compilation aborted at /home/xenoterracide/test/lib/MyApp/User.pm line 3. Compilation failed in require at t/test.t line 6. On Sun, Sep 16, 2012 at 12:33 PM, Dave Rolsky via RT <bug-Moose@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=78852 > > > On Thu Aug 09 17:28:02 2012, XENO wrote:
>> On Wed, Aug 8, 2012 at 4:54 PM, Dave Rolsky via RT >> <bug-Moose@rt.cpan.org> wrote:
>> > <URL: https://rt.cpan.org/Ticket/Display.html?id=78852 > >> > >> > On Wed Aug 08 17:50:46 2012, XENO wrote:
>> >> When trying to follow this recipe I got the error >> >> >> >> Can't locate Moose::Meta::Class::Custom::Trait::Type or Type in
>> @INC
>> >> >> >> I substituted MyApp for my actual app name and had the role named
>> Type
>> >> with a Type attribute instead of table, but otherwise the code is >> >> identical. renaming and moving to Moose::Meta::Custom::Trait::Type >> >> resolved the issue >> >> >> >> MyApp::Meta::Class::Trait::Type does not work (at least without >> >> another step )
>> > >> > I suspect the problem may be this, from the recipe text: >> > >> > RECIPE CAVEAT >> > >> > This recipe doesn't work when you paste it all into a single file.
>> This
>> > is because the use Moose -traits => 'HasTable'; line ends up being
>> executed before the table attribute is defined.
>> > >> > When the two packages are separate files, this just works.
>> >> I had them as separate files, it did not recognize the MyApp prefix, >> the problem was the namespacing, moose was looking in a certain place >> for 'HasTable' and it wasn't MyApp. It was Moose::... Custom... Trait
> > Maybe you're missing this bit: > > Moose::Util::meta_class_alias('HasTable') >
-- Caleb Cushing http://xenoterracide.com
Download test.tar.gz
application/x-gzip 9.6k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 256b
You actually have to load the trait if you are putting them in separate classes. If the trait isn't loaded, the meta_class_alias function will never be called, and so it won't be registered. In a real extension, this would typically happen in the exporter.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.