move from Eventful repo to its own
[gitmo/MooseX-Runnable.git] / lib / MooseX / Runnable.pm
CommitLineData
d42333d2 1package MooseX::Runnable;
2use Moose::Role;
3
4our $RUNNING_APP;
5
6requires 'run';
7
8sub run_as_application {
9 my $class = shift;
10 my @args = @_;
11
12 if($class->does('MooseX::Getopt')){
13 my $self = $class->new_with_options(@args);
14 local $RUNNING_APP = $self;
15 exit $self->run( $self->extra_argv );
16 }
17
18 local $RUNNING_APP = $class->new(@args);
19 exit $RUNNING_APP->run;
20}
21
221;