X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FCGI.pm;h=48e1d43b4554167c208351ac220fb8bef7eda542;hb=80a909c28a951c5f2a9a98ab673c4c0a295b6988;hp=bdbf15cd97932f5e4fb9dc98c2ff5846bf2a90cd;hpb=0ba6e8aaafec7621c9444f470a849bd161f176e0;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Script/CGI.pm b/lib/Catalyst/Script/CGI.pm index bdbf15c..48e1d43 100644 --- a/lib/Catalyst/Script/CGI.pm +++ b/lib/Catalyst/Script/CGI.pm @@ -1,3 +1,25 @@ package Catalyst::Script::CGI; +use Moose; +BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' } +use FindBin qw/$Bin/; +use lib "$Bin/../lib"; +use Pod::Usage; +use Moose; +use namespace::autoclean -except => [ qw(meta) ]; + +with 'MooseX::Getopt'; + +has app => ( isa => 'Str', is => 'ro', required => 1 ); +has help => ( isa => 'Bool', is => 'ro', required => 0, default => sub { 0 } ); + +sub run { + my $self = shift; + + pod2usage() if $self->help; + my $app = $self->app; + Class::MOP::load_class($app); + $app->run; + +} 1;