updated testapp_cgi.pl
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / CGI.pm
index bdbf15c..c894c73 100644 (file)
@@ -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::clean -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;