From: Jonathan Rockway Date: Wed, 29 Apr 2009 15:48:24 +0000 (-0500) Subject: make PAR work with new plugin scheme X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dcfde64f8f690d4a9f3c64ee10190de1b09266e6;p=gitmo%2FMooseX-Runnable.git make PAR work with new plugin scheme --- diff --git a/lib/MooseX/Runnable/Invocation/Plugin/PAR.pm b/lib/MooseX/Runnable/Invocation/Plugin/PAR.pm index ab05dd4..f2d6c8d 100644 --- a/lib/MooseX/Runnable/Invocation/Plugin/PAR.pm +++ b/lib/MooseX/Runnable/Invocation/Plugin/PAR.pm @@ -5,6 +5,8 @@ use Module::ScanDeps (); use App::Packer::PAR (); use MooseX::Runnable::Run; +use Data::Dump::Streamer; + use File::Temp qw(tempfile); my $mk_scanner = sub { @@ -37,19 +39,25 @@ around run => sub { my $inc = join " ", map { "require '$_';\n" } keys %INC; - my $plugins = join ', ', map { "'$_'" } grep { $_ ne 'PAR' } @{$self->plugins}; + my %plugins = %{ $self->plugins }; + delete $plugins{PAR}; + my $plugins = Dump(\%plugins)->Out; + my $app = $self->class; my $script = <<"END"; use MooseX::Runnable::Run; use MooseX::Runnable::Invocation; require Params::Validate; # XXX! $inc +$plugins exit MooseX::Runnable::Invocation->new( class => '$app', - plugins => [$plugins], + plugins => \$HASH1, )->run(\@ARGV); END + print "script: \n$script"; + $app =~ s/::/_/g; $app = lc $app;