[Catalyst-commits] r10656 - in
Catalyst-Runtime/5.80/branches/better_scripts:
lib/Catalyst/Script t/TestApp/script
dhoss at dev.catalyst.perl.org
dhoss at dev.catalyst.perl.org
Thu Jun 25 02:30:42 GMT 2009
Author: dhoss
Date: 2009-06-25 02:30:41 +0000 (Thu, 25 Jun 2009)
New Revision: 10656
Modified:
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/CGI.pm
Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Test.pm
Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_cgi.pl
Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_fastcgi.pl
Log:
updated testapp_cgi.pl
updated CGI
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/CGI.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/CGI.pm 2009-06-25 02:22:27 UTC (rev 10655)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/CGI.pm 2009-06-25 02:30:41 UTC (rev 10656)
@@ -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;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Test.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Test.pm 2009-06-25 02:22:27 UTC (rev 10655)
+++ Catalyst-Runtime/5.80/branches/better_scripts/lib/Catalyst/Script/Test.pm 2009-06-25 02:30:41 UTC (rev 10656)
@@ -1,3 +1,3 @@
package Catalyst::Script::Test;
-
+use Moose;
1;
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_cgi.pl
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_cgi.pl 2009-06-25 02:22:27 UTC (rev 10655)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_cgi.pl 2009-06-25 02:30:41 UTC (rev 10656)
@@ -1,15 +1,12 @@
#!/usr/bin/env perl
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+use FindBin qw/$Bin/;
-use strict;
-use warnings;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use TestApp;
+## because this is a test
+use lib "$Bin/../../../lib";
+use Catalyst::ScriptRunner;
+Catalyst::ScriptRunner->run('Catalyst','CGI');
-TestApp->run;
-
1;
=head1 NAME
Modified: Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_fastcgi.pl
===================================================================
--- Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_fastcgi.pl 2009-06-25 02:22:27 UTC (rev 10655)
+++ Catalyst-Runtime/5.80/branches/better_scripts/t/TestApp/script/testapp_fastcgi.pl 2009-06-25 02:30:41 UTC (rev 10656)
@@ -6,7 +6,7 @@
use lib "$Bin/../../../lib";
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('Catalyst','FastCGI');
-
+1;
=head1 NAME
testapp_fastcgi.pl - Catalyst FastCGI
More information about the Catalyst-commits
mailing list