From: Jonathan Rockway Date: Wed, 29 Apr 2009 14:57:29 +0000 (-0500) Subject: at least pass plugin args to ::Invocation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Runnable.git;a=commitdiff_plain;h=a19e41e357e856823b68d577a1a8901d27679511 at least pass plugin args to ::Invocation --- diff --git a/bin/mx-run b/bin/mx-run index 1586e63..6e9ddf3 100644 --- a/bin/mx-run +++ b/bin/mx-run @@ -27,7 +27,7 @@ sub run { return MooseX::Runnable::Invocation->new( class => $app, - plugins => [ keys %{$args->plugins} ], # XXX: fixme + plugins => $args->plugins, )->run($args->app_args); } diff --git a/lib/MooseX/Runnable/Invocation.pm b/lib/MooseX/Runnable/Invocation.pm index 1a7bdd7..16db55b 100644 --- a/lib/MooseX/Runnable/Invocation.pm +++ b/lib/MooseX/Runnable/Invocation.pm @@ -1,7 +1,7 @@ package MooseX::Runnable::Invocation; use Moose; use MooseX::Types -declare => ['RunnableClass']; -use MooseX::Types::Moose qw(Str ClassName); +use MooseX::Types::Moose qw(Str HashRef ArrayRef); use namespace::autoclean; require Class::MOP; @@ -25,7 +25,7 @@ has 'class' => ( has 'plugins' => ( is => 'ro', - isa => 'ArrayRef[Str]', + isa => HashRef[ArrayRef[Str]], default => sub { [] }, required => 1, auto_deref => 1, @@ -33,7 +33,7 @@ has 'plugins' => ( sub BUILD { my $self = shift; - $self->load_plugin($_) for $self->plugins; + $self->load_plugin($_) for keys %{$self->plugins}; } sub load_class {