From: Jonathan Rockway Date: Thu, 25 Jun 2009 21:42:34 +0000 (-0700) Subject: add run_application_with_plugins to mx::run X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=406bfd3a105767f122e616652d720443d27e5995;p=gitmo%2FMooseX-Runnable.git add run_application_with_plugins to mx::run --- diff --git a/lib/MooseX/Runnable/Run.pm b/lib/MooseX/Runnable/Run.pm index 9e1ab01..765c090 100644 --- a/lib/MooseX/Runnable/Run.pm +++ b/lib/MooseX/Runnable/Run.pm @@ -12,6 +12,14 @@ sub run_application($;@) { )->run(@args); } +sub run_application_with_plugins($$;@){ + my ($app, $plugins, @args) = @_; + exit MooseX::Runnable::Invocation->new( + class => $app, + plugins => $plugins, + )->run(@args); +} + sub import { my ($class, $app) = @_; @@ -22,6 +30,7 @@ sub import { my $c = caller; no strict 'refs'; *{ $c. '::run_application' } = \&run_application; + *{ $c. '::run_application_with_plugins' } = \&run_application_with_plugins; } }