drop namespace::autoclean
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / CGI.pm
index c894c73..4eb9be8 100644 (file)
@@ -1,25 +1,40 @@
 package Catalyst::Script::CGI;
 use Moose;
+use namespace::clean -except => [ 'meta' ];
 
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
-use FindBin qw/$Bin/;
-use lib "$Bin/../lib";
-use Pod::Usage;
-use Moose;
-use namespace::clean -except => [ qw(meta) ];
+sub _plack_engine_name { 'CGI' }
+
+with 'Catalyst::ScriptRole';
 
-with 'MooseX::Getopt';
+__PACKAGE__->meta->make_immutable;
+1;
 
-has app  => ( isa => 'Str',    is => 'ro', required => 1 );
-has help => ( isa => 'Bool',   is => 'ro', required => 0, default => sub { 0 } );
+=head1 NAME
 
-sub run {
-    my $self = shift;
-    
-    pod2usage() if $self->help;
-    my $app = $self->app;
-    Class::MOP::load_class($app);
-    $app->run;
+Catalyst::Script::CGI - The CGI Catalyst Script
 
-}
-1;
+=head1 SYNOPSIS
+
+  myapp_cgi.pl [options]
+
+  Options:
+  -?     --help           display this help and exits
+
+=head1 DESCRIPTION
+
+This is a script to run the Catalyst engine specialized for the CGI environment.
+
+=head1 SEE ALSO
+
+L<Catalyst::ScriptRunner>
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut