add run_application_with_plugins to mx::run
Jonathan Rockway [Thu, 25 Jun 2009 21:42:34 +0000 (14:42 -0700)]
lib/MooseX/Runnable/Run.pm

index 9e1ab01..765c090 100644 (file)
@@ -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;
     }
 }