[Catalyst-commits] r10262 - in Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison: . lib lib/TestAppForComparison/Controller script t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Sun May 24 11:09:46 GMT 2009


Author: t0m
Date: 2009-05-24 11:09:45 +0000 (Sun, 24 May 2009)
New Revision: 10262

Modified:
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Changes
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Makefile.PL
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison.pm
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison/Controller/Root.pm
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_cgi.pl
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_create.pl
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_fastcgi.pl
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_server.pl
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_test.pl
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/01app.t
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/02pod.t
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/03podcoverage.t
   Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/testappforcomparison.conf
Log:
Erm, the test app for comparison needs to be generated with the current code, or it doesn't compare the same

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Changes
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Changes	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Changes	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,4 +1,4 @@
 This file documents the revision history for Perl extension TestAppForComparison.
 
-0.01  2009-05-23 15:40:19
+0.01  2009-05-24 12:05:11
         - initial revision, generated by Catalyst

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Makefile.PL
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Makefile.PL	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/Makefile.PL	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,11 +1,12 @@
+#!/usr/bin/env perl
 # IMPORTANT: if you delete this file your app will not work as
-# expected.  you have been warned
+# expected.  You have been warned.
 use inc::Module::Install;
 
 name 'TestAppForComparison';
 all_from 'lib/TestAppForComparison.pm';
 
-requires 'Catalyst::Runtime' => '5.80002';
+requires 'Catalyst::Runtime' => '5.80004';
 requires 'Catalyst::Plugin::ConfigLoader';
 requires 'Catalyst::Plugin::Static::Simple';
 requires 'Catalyst::Action::RenderView';

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison/Controller/Root.pm
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison/Controller/Root.pm	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison/Controller/Root.pm	2009-05-24 11:09:45 UTC (rev 10262)
@@ -49,11 +49,11 @@
 
 =head1 AUTHOR
 
-Devin Austin,,,
+Tomas Doran,,,
 
 =head1 LICENSE
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison.pm
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison.pm	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/lib/TestAppForComparison.pm	2009-05-24 11:09:45 UTC (rev 10262)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Catalyst::Runtime '5.70';
+use Catalyst::Runtime 5.80;
 
 # Set flags and add plugins for the application
 #
@@ -52,11 +52,11 @@
 
 =head1 AUTHOR
 
-Devin Austin,,,
+Tomas Doran,,,
 
 =head1 LICENSE
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_cgi.pl
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_cgi.pl	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_cgi.pl	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
 
@@ -31,7 +31,7 @@
 =head1 COPYRIGHT
 
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_create.pl
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_create.pl	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_create.pl	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
@@ -51,7 +51,6 @@
 
  Examples:
    testappforcomparison_create.pl controller My::Controller
-   testappforcomparison_create.pl controller My::Controller BindLex
    testappforcomparison_create.pl -mechanize controller My::Controller
    testappforcomparison_create.pl view My::View
    testappforcomparison_create.pl view MyView TT
@@ -80,7 +79,7 @@
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_fastcgi.pl
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_fastcgi.pl	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_fastcgi.pl	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
 
@@ -31,7 +31,7 @@
         pidfile => $pidfile,
         manager => $manager,
         detach  => $detach,
-	keep_stderr => $keep_stderr,
+        keep_stderr => $keep_stderr,
     }
 );
 
@@ -73,7 +73,7 @@
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_server.pl
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_server.pl	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_server.pl	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,8 +1,8 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 BEGIN {
     $ENV{CATALYST_ENGINE} ||= 'HTTP';
-    $ENV{CATALYST_SCRIPT_GEN} = 32;
+    $ENV{CATALYST_SCRIPT_GEN} = 38;
     require Catalyst::Engine::HTTP;
 }
 
@@ -20,51 +20,92 @@
 my $port              = $ENV{TESTAPPFORCOMPARISON_PORT} || $ENV{CATALYST_PORT} || 3000;
 my $keepalive         = 0;
 my $restart           = $ENV{TESTAPPFORCOMPARISON_RELOAD} || $ENV{CATALYST_RELOAD} || 0;
-my $restart_delay     = 1;
-my $restart_regex     = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.conf|\.pm)$';
-my $restart_directory = undef;
-my $follow_symlinks   = 0;
+my $background        = 0;
+my $pidfile           = undef;
 
+my $check_interval;
+my $file_regex;
+my $watch_directory;
+my $follow_symlinks;
+
 my @argv = @ARGV;
 
 GetOptions(
     'debug|d'             => \$debug,
-    'fork'                => \$fork,
+    'fork|f'              => \$fork,
     'help|?'              => \$help,
     'host=s'              => \$host,
-    'port=s'              => \$port,
+    'port|p=s'            => \$port,
     'keepalive|k'         => \$keepalive,
     'restart|r'           => \$restart,
-    'restartdelay|rd=s'   => \$restart_delay,
-    'restartregex|rr=s'   => \$restart_regex,
-    'restartdirectory=s@' => \$restart_directory,
+    'restartdelay|rd=s'   => \$check_interval,
+    'restartregex|rr=s'   => \$file_regex,
+    'restartdirectory=s@' => \$watch_directory,
     'followsymlinks'      => \$follow_symlinks,
+    'background'          => \$background,
+    'pidfile=s'           => \$pidfile,
 );
 
 pod2usage(1) if $help;
 
-if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) {
-    $ENV{CATALYST_ENGINE} = 'HTTP::Restarter';
-}
 if ( $debug ) {
     $ENV{CATALYST_DEBUG} = 1;
 }
 
-# This is require instead of use so that the above environment
-# variables can be set at runtime.
-require TestAppForComparison;
+# If we load this here, then in the case of a restarter, it does not
+# need to be reloaded for each restart.
+require Catalyst;
 
-TestAppForComparison->run( $port, $host, {
-    argv              => \@argv,
-    'fork'            => $fork,
-    keepalive         => $keepalive,
-    restart           => $restart,
-    restart_delay     => $restart_delay,
-    restart_regex     => qr/$restart_regex/,
-    restart_directory => $restart_directory,
-    follow_symlinks   => $follow_symlinks,
-} );
+# If this isn't done, then the Catalyst::Devel tests for the restarter
+# fail.
+$| = 1 if $ENV{HARNESS_ACTIVE};
 
+my $runner = sub {
+    # This is require instead of use so that the above environment
+    # variables can be set at runtime.
+    require TestAppForComparison;
+
+    TestAppForComparison->run(
+        $port, $host,
+        {
+            argv       => \@argv,
+            'fork'     => $fork,
+            keepalive  => $keepalive,
+            background => $background,
+            pidfile    => $pidfile,
+        }
+    );
+};
+
+if ( $restart ) {
+    die "Cannot run in the background and also watch for changed files.\n"
+        if $background;
+
+    require Catalyst::Restarter;
+
+    my $subclass = Catalyst::Restarter->pick_subclass;
+
+    my %args;
+    $args{follow_symlinks} = 1
+        if $follow_symlinks;
+    $args{directories} = $watch_directory
+        if defined $watch_directory;
+    $args{sleep_interval} = $check_interval
+        if defined $check_interval;
+    $args{filter} = qr/$file_regex/
+        if defined $file_regex;
+
+    my $restarter = $subclass->new(
+        %args,
+        start_sub => $runner,
+    );
+
+    $restarter->run_and_watch;
+}
+else {
+    $runner->();
+}
+
 1;
 
 =head1 NAME
@@ -86,6 +127,7 @@
    -r -restart        restart when files get modified
                       (defaults to false)
    -rd -restartdelay  delay between file checks
+                      (ignored if you have Linux::Inotify2 installed)
    -rr -restartregex  regex match files that trigger
                       a restart when modified
                       (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
@@ -94,6 +136,9 @@
                       (defaults to '[SCRIPT_DIR]/..')
    -follow_symlinks   follow symlinks in search directories
                       (defaults to false. this is a no-op on Win32)
+   -background        run the process in the background
+   -pidfile           specify filename for pid file
+
  See also:
    perldoc Catalyst::Manual
    perldoc Catalyst::Manual::Intro
@@ -108,7 +153,7 @@
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_test.pl
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_test.pl	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/script/testappforcomparison_test.pl	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
@@ -47,7 +47,7 @@
 
 =head1 COPYRIGHT
 
-This library is free software, you can redistribute it and/or modify
+This library is free software. You can redistribute it and/or modify
 it under the same terms as Perl itself.
 
 =cut

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/01app.t
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/01app.t	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/01app.t	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
 use strict;
 use warnings;
 use Test::More tests => 2;

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/02pod.t
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/02pod.t	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/02pod.t	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
 use strict;
 use warnings;
 use Test::More;

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/03podcoverage.t
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/03podcoverage.t	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/t/03podcoverage.t	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,3 +1,4 @@
+#!/usr/bin/env perl
 use strict;
 use warnings;
 use Test::More;

Modified: Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/testappforcomparison.conf
===================================================================
--- Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/testappforcomparison.conf	2009-05-23 22:09:30 UTC (rev 10261)
+++ Catalyst-Devel/1.00/branches/helper_refactor/t/TestAppForComparison/testappforcomparison.conf	2009-05-24 11:09:45 UTC (rev 10262)
@@ -1,3 +1,3 @@
-# rename this file to TestAppForComparison.yml and put a : in front of "name" if
-# you want to use yaml like in old versions of Catalyst
+# rename this file to TestAppForComparison.yml and put a ':' in front of 'name' if
+# you want to use YAML like in old versions of Catalyst
 name TestAppForComparison




More information about the Catalyst-commits mailing list