Skip Menu |

This queue is for tickets about the MooseX-Runnable CPAN distribution.

Report information
The Basics
Id: 58028
Status: resolved
Priority: 0/
Queue: MooseX-Runnable

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

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: 0.03



Subject: RunnableClass subtype is too restrictive
When making the class 'B5::HelloWorld' runnable as per the example in the docs, I get: : [www-data@karene codescraps/mx-run].0$; mx-run -I. B5::HelloWorld ether Attribute (class) does not pass the type constraint because: Validation failed for 'MooseX::Runnable::Invocation::RunnableClass' with value B5::HelloWorld at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Attribute.pm line 746 Moose::Meta::Attribute::_coerce_and_verify('Moose::Meta::Attribute=HASH(0xa3a124c)', 'B5::HelloWorld', 'MooseX::Runnable::Invocation::MxRun=HASH(0xa3a62cc)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Attribute.pm line 398 Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Attribute=HASH(0xa3a124c)', 'Moose::Meta::Instance=HASH(0xa3c16cc)', 'MooseX::Runnable::Invocation::MxRun=HASH(0xa3a62cc)', 'HASH(0xa3a64d0)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Class.pm line 567 Class::MOP::Class::_construct_instance('Moose::Meta::Class=HASH(0xa1211ec)', 'HASH(0xa3a64d0)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Class.pm line 540 Class::MOP::Class::new_object('Moose::Meta::Class=HASH(0xa1211ec)', 'HASH(0xa3a64d0)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm line 256 Moose::Meta::Class::new_object('Moose::Meta::Class=HASH(0xa1211ec)', 'HASH(0xa3a64d0)') called at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Object.pm line 25 Moose::Object::new('MooseX::Runnable::Invocation::MxRun', 'class', 'B5::HelloWorld', 'plugins', 'HASH(0xa27ce10)', 'parsed_args', 'MooseX::Runnable::Util::ArgParser=HASH(0xa3255e0)') called at /usr/bin/mx-run line 35 main::run() called at /usr/bin/mx-run line 9 This is because of the definition in MooseX::Runnable::Invocation: subtype RunnableClass, as Str, where { $_ =~ /^[:A-Za-z_]+$/ }; It really ought to accept any valid Moose class: subtype RunnableClass, as ClassName, where { $_->can('does') and $_->does('MooseX::Runnable' }; This is breaking my heart because the app name of my project is 'B5'. :)
From: bitcard [...] froods.org
Or this is even better: 15:29 <@rafl> role_type RunnableClass, { role => 'MooseX::Runnable' } On Tue Jun 01 18:28:44 2010, bitcard@froods.org wrote: Show quoted text
> It really ought to accept any valid Moose class: > > subtype RunnableClass, > as ClassName, > where { $_->can('does') and $_->does('MooseX::Runnable' }; >
From: bitcard [...] froods.org
Since the class isn't necessarily loaded yet, that won't work, but this will (I'm sure there's a classname validation regexp in Moose core somewhere but I can't find it right now): ... where { $_ =~ /^([A-Za-z][A-Za-z_0-9]+)(::[A-Za-z][A-Za-z_0-9]+)*$/ }; On Tue Jun 01 18:32:08 2010, bitcard@froods.org wrote: Show quoted text
> Or this is even better: > 15:29 <@rafl> role_type RunnableClass, { role => 'MooseX::Runnable' }
From: bitcard [...] froods.org
The last update, I swear! MooseX::Types::LoadableClass :) On Tue Jun 01 18:44:49 2010, bitcard@froods.org wrote: Show quoted text
> Since the class isn't necessarily loaded yet, that won't work, but this > will (I'm sure there's a classname validation regexp in Moose core > somewhere but I can't find it right now)...
From: bitcard [...] froods.org
CC: undisclosed-recipients:;
Subject: Re: [rt.cpan.org #58028] RunnableClass subtype is too restrictive
Date: Sat, 12 Jun 2010 00:26:59 -0500
To: bug-MooseX-Runnable [...] rt.cpan.org
From: Jonathan Rockway <jon [...] jrock.us>
* On Fri, Jun 11 2010, Karen Etheridge via RT wrote: Show quoted text
> Queue: MooseX-Runnable > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58028 > > > I've added a fix at http://github.com/karenetheridge/moosex-runnable/.
Seems like you forgot to push. -- print just => another => perl => hacker => if $,=$"
From: bitcard [...] froods.org
On Sat Jun 12 01:27:08 2010, jon@jrock.us wrote: Show quoted text
> Seems like you forgot to push.
Now pushed.
It looks like this was fixed in 0.03, so can the ticket be closed?