updated testapp_cgi.pl
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / CGI.pm
1 package Catalyst::Script::CGI;
2 use Moose;
3
4 BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
5 use FindBin qw/$Bin/;
6 use lib "$Bin/../lib";
7 use Pod::Usage;
8 use Moose;
9 use namespace::clean -except => [ qw(meta) ];
10
11 with 'MooseX::Getopt';
12
13 has app  => ( isa => 'Str',    is => 'ro', required => 1 );
14 has help => ( isa => 'Bool',   is => 'ro', required => 0, default => sub { 0 } );
15
16 sub run {
17     my $self = shift;
18     
19     pod2usage() if $self->help;
20     my $app = $self->app;
21     Class::MOP::load_class($app);
22     $app->run;
23
24 }
25 1;