Skip Menu |

This queue is for tickets about the Mousse CPAN distribution.

Report information
The Basics
Id: 62935
Status: resolved
Priority: 0/
Queue: Mousse

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

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



Subject: make_from_mouse() does not work for multi-word namespaces.
make_from_mouse() generates a file that is not usable. I have attached the result of perl -MMousse::Maker -we 'Mousse::Maker::make_from_mouse("Test::Builder2::Mouse")' When loaded, there is an error: Can't locate Test/Builder2/Mouse/Meta/Method/Constructor.pm in @INC (@INC contains: lib /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/site_perl/5.12.2/darwin-thread-multi-2level /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/site_perl/5.12.2 /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/5.12.2/darwin-thread-multi-2level /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/5.12.2 .) at lib/Test/Builder2/Mouse.pm line 306. BEGIN failed--compilation aborted at lib/Test/Builder2/Mouse.pm line 306. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. This stems from an improperly converted set of %INC statements at the top of the file. Here is an example: $INC{'Test::Builder2::Mouse.pm'} = __FILE__; That should be: $INC{'Test/Builder2/Mouse.pm'} = __FILE__; A similar problem is at lines 1114, 3995 and 4002. require 'Test::Builder2::Mouse/PurePerl.pm'; To do the replacement properly, instances of m{Mouse\.pm} or m{Mouse/} should be replaced with "Test/Builder2/Mouse.pm" and "Test/Builder2/Mouse/" respectively. Here is the set of replacements I use for Test::Builder2's custom eat_mouse script which works well. You should be able to adapt it. https://github.com/schwern/test-more/blob/Test-Builder2/dist/eat_mouse s{Mouse.pm}{Test/Builder2/Mouse.pm}g s{Mouse/}{Test/Builder2/Mouse/}g s{Mouse::}{Test::Builder2::Mouse::}g # Special case for "use Mouse () s{use Mouse }{use Test::Builder2::Mouse }g # Special case for 'Mouse' and 'Mouse::Foo' s{(['"])(Mouse[:\w+]*)\1}{$1Test::Builder2::$2$1}g # Special case for "package Mouse;" s{package Mouse;}{package Test::Builder2::Mouse;}g; The Mousse tests work because it only converts it to a single word package. They should try a multi-word package such as Chocolate::Mousse.
Subject: Mouse.pm

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #62935] make_from_mouse() does not work for multi-word namespaces.
Date: Fri, 12 Nov 2010 11:29:59 +1100
To: bug-Mousse [...] rt.cpan.org
From: Ingy dot Net <ingy [...] ingy.net>
Thanks Schwern, I'll pop out a new version today. Ingy On Fri, Nov 12, 2010 at 11:12 AM, Michael G Schwern via RT < bug-Mousse@rt.cpan.org> wrote: Show quoted text
> Thu Nov 11 19:12:25 2010: Request 62935 was acted upon. > Transaction: Ticket created by MSCHWERN > Queue: Mousse > Subject: make_from_mouse() does not work for multi-word namespaces. > Broken in: 0.11 > Severity: Critical > Owner: Nobody > Requestors: mschwern@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=62935 > > > > make_from_mouse() generates a file that is not usable. I have attached > the result of > > perl -MMousse::Maker -we > 'Mousse::Maker::make_from_mouse("Test::Builder2::Mouse")' > > When loaded, there is an error: > > Can't locate Test/Builder2/Mouse/Meta/Method/Constructor.pm in @INC > (@INC contains: lib > > /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/site_perl/5.12.2/darwin-thread-multi-2level > /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/site_perl/5.12.2 > > /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/5.12.2/darwin-thread-multi-2level > /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/5.12.2 .) at > lib/Test/Builder2/Mouse.pm line 306. > BEGIN failed--compilation aborted at lib/Test/Builder2/Mouse.pm line 306. > Compilation failed in require at -e line 1. > BEGIN failed--compilation aborted at -e line 1. > > This stems from an improperly converted set of %INC statements at the > top of the file. Here is an example: > > $INC{'Test::Builder2::Mouse.pm'} = __FILE__; > > That should be: > > $INC{'Test/Builder2/Mouse.pm'} = __FILE__; > > A similar problem is at lines 1114, 3995 and 4002. > > require 'Test::Builder2::Mouse/PurePerl.pm'; > > To do the replacement properly, instances of m{Mouse\.pm} or m{Mouse/} > should be replaced with "Test/Builder2/Mouse.pm" and > "Test/Builder2/Mouse/" respectively. > > Here is the set of replacements I use for Test::Builder2's custom > eat_mouse script which works well. You should be able to adapt it. > https://github.com/schwern/test-more/blob/Test-Builder2/dist/eat_mouse > > s{Mouse.pm}{Test/Builder2/Mouse.pm}g > s{Mouse/}{Test/Builder2/Mouse/}g > s{Mouse::}{Test::Builder2::Mouse::}g > > # Special case for "use Mouse () > s{use Mouse }{use Test::Builder2::Mouse }g > > # Special case for 'Mouse' and 'Mouse::Foo' > s{(['"])(Mouse[:\w+]*)\1}{$1Test::Builder2::$2$1}g > > # Special case for "package Mouse;" > s{package Mouse;}{package Test::Builder2::Mouse;}g; > > The Mousse tests work because it only converts it to a single word > package. They should try a multi-word package such as Chocolate::Mousse. >
Fixed in 0.12. There was nothing wrong with Mousse in multi-word namespaces... Mousse::Maker was just invoking something wrong when not using M:I Now it's all fixed, tested and documented. Thanks.