[Catalyst-commits] r9813 - in Catalyst-Devel/1.00/branches/improved-restarter: . lib/Catalyst t t/lib

autarch at dev.catalyst.perl.org autarch at dev.catalyst.perl.org
Fri Apr 24 02:08:29 GMT 2009


Author: autarch
Date: 2009-04-24 03:08:29 +0100 (Fri, 24 Apr 2009)
New Revision: 9813

Added:
   Catalyst-Devel/1.00/branches/improved-restarter/.gitignore
   Catalyst-Devel/1.00/branches/improved-restarter/t/lib/
   Catalyst-Devel/1.00/branches/improved-restarter/t/lib/UnknownError.pm
Modified:
   Catalyst-Devel/1.00/branches/improved-restarter/
   Catalyst-Devel/1.00/branches/improved-restarter/Changes
   Catalyst-Devel/1.00/branches/improved-restarter/MANIFEST.SKIP
   Catalyst-Devel/1.00/branches/improved-restarter/Makefile.PL
   Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Devel.pm
   Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Restarter.pm
Log:
merge from trunk


Property changes on: Catalyst-Devel/1.00/branches/improved-restarter
___________________________________________________________________
Name: svk:merge
   + 4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Devel/1.00/trunk:9801
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Devel:6899
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Helper:4258

Added: Catalyst-Devel/1.00/branches/improved-restarter/.gitignore
===================================================================
--- Catalyst-Devel/1.00/branches/improved-restarter/.gitignore	                        (rev 0)
+++ Catalyst-Devel/1.00/branches/improved-restarter/.gitignore	2009-04-24 02:08:29 UTC (rev 9813)
@@ -0,0 +1,15 @@
+.*
+!.gitignore
+Makefile*
+!Makefile.PL
+META.yml
+blib
+build
+inc
+pm_to_blib
+MANIFEST*
+!MANIFEST.SKIP
+Debian*
+README
+Catalyst-Devel-*
+*.bs

Modified: Catalyst-Devel/1.00/branches/improved-restarter/Changes
===================================================================
--- Catalyst-Devel/1.00/branches/improved-restarter/Changes	2009-04-24 02:06:19 UTC (rev 9812)
+++ Catalyst-Devel/1.00/branches/improved-restarter/Changes	2009-04-24 02:08:29 UTC (rev 9813)
@@ -1,10 +1,13 @@
 This file documents the revision history for Perl extension Catalyst-Devel.
 
+1.11    2009-04-22 19:02
+        - Add check for "Unknown error" bug (caelum)
         - Change generated scripts to use /usr/bin/env perl if /usr/bin/env
           exists, otherwise fall back to the current perl binary. (t0m)
         - Fix getopt spec in generated scripts to match docs (rjbs)
         - Additional documentation (ash)
         - Informational message after an application is created (kd)
+        - Add a -background option to the dev server (duncs)
 
 1.10    2009-02-05 15:04
         - fix a bug in created helper scripts that prevened them working (rjbs)
@@ -13,10 +16,6 @@
         - Add Sebastian's PROJECT FOUNDER note to Devel.pm as requested
         - Fix warning when devel is not installed.
 
-1.09    2009-02-04 23:57
-        - Add Sebastian's PROJECT FOUNDER note to Devel.pm as requested
-        - Fix warning when devel is not installed.
-        
 1.08    2008-07-13 18:00
         - Revert to use Catalyst qw/@plugins/
         - Require Config::General instead of YAML
@@ -27,13 +26,13 @@
         - Made a warning in the generated Makefile.PL not to delete it.
         -  Incorrect generated pod.
 
-1.06	2008-04-09 08:19:00
+1.06    2008-04-09 08:19:00
         - load plugins in setup, not plugins. (ema_zep at libero.it)
 
-1.05	2008-04-07 11:55:00
+1.05    2008-04-07 11:55:00
         - Add missing parent dependency to created projects.
 
-1.04	2008-04-06 16:04:00
+1.04    2008-04-06 16:04:00
         - Update default actions in Root.pm
         - Patch Helper.pm so Module::Pluggable::Object ignores emacs temp
           files appropriately for restarting server
@@ -48,14 +47,14 @@
         - Added BindLex example to create script
         - Don't change a manually-specified engine when using the
           -r switch with server.pl
-        
+
 1.02    2006-11-15  16:45:00
         - Added dep to Catalyst::Manual
         - added option to send errors to STDOUT in fastcgi script
 
-1.01	2006-09-17 23:49:00
+1.01    2006-09-17 23:49:00
         - Upped M::I dependency
-	    - fix for warnings
+        - fix for warnings
 
 1.00    2006-07-06 19:23:00
         - Initial release

Modified: Catalyst-Devel/1.00/branches/improved-restarter/MANIFEST.SKIP
===================================================================
--- Catalyst-Devel/1.00/branches/improved-restarter/MANIFEST.SKIP	2009-04-24 02:06:19 UTC (rev 9812)
+++ Catalyst-Devel/1.00/branches/improved-restarter/MANIFEST.SKIP	2009-04-24 02:08:29 UTC (rev 9813)
@@ -3,6 +3,7 @@
 \bCVS\b
 ,v$
 \B\.svn\b
+\B\.git
 
 # Avoid Makemaker generated and utility files.
 \bMakefile$

Modified: Catalyst-Devel/1.00/branches/improved-restarter/Makefile.PL
===================================================================
--- Catalyst-Devel/1.00/branches/improved-restarter/Makefile.PL	2009-04-24 02:06:19 UTC (rev 9812)
+++ Catalyst-Devel/1.00/branches/improved-restarter/Makefile.PL	2009-04-24 02:08:29 UTC (rev 9813)
@@ -15,6 +15,48 @@
 requires 'Path::Class' => '0.09';
 requires 'Template'    => '2.14';
 
+if (!$ENV{CATALYST_DEVEL_NO_510_CHECK}) {
+    use Symbol 'gensym';
+    use IPC::Open3;
+    use File::Spec;
+    open NULL, '>', File::Spec->devnull;
+    my $err = gensym;
+    my $pid = open3(gensym, '&>NULL', $err, "$^X -It/lib -MUnknownError -e 1");
+    
+    my $unknown_error = 0;
+
+    while (<$err>) {
+        $unknown_error = 1 if /^Unknown error/;
+    }
+
+    waitpid $pid, 0;
+
+    if ($unknown_error) {
+        warn <<EOE;
+############################### WARNING #################################
+#                                                                       #
+# You are using perl 5.10.0 with the "Unknown error" bug. This can make #
+# developing Catalyst applications much more painful, as it will come   # 
+# up with no details every time you have a syntax error in a Controller.#
+#                                                                       #
+# For more information see:                                             #
+#                                                                       #
+#  * http://rt.perl.org/rt3/Public/Bug/Display.html?id=49472            #
+#                                                                       #
+# It is highly recommended that you use a different version of perl or  #
+# compile a patched version for Catalyst development.                   #
+#                                                                       #
+# To skip this check, set the CATALYST_DEVEL_NO_510_CHECK environment   #
+# variable.                                                             #
+#                                                                       #
+#########################################################################
+
+EOE
+        my $ans = prompt('Do you want to continue?', 'no');
+        exit 0 unless $ans =~ /^y(es)?\z/i;
+    }
+}
+
 auto_install;
 
 WriteAll;

Modified: Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Devel.pm
===================================================================
--- Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Devel.pm	2009-04-24 02:06:19 UTC (rev 9812)
+++ Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Devel.pm	2009-04-24 02:08:29 UTC (rev 9813)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION             = '1.10';
+our $VERSION             = '1.11';
 our $CATALYST_SCRIPT_GEN = 33;
 
 =head1 NAME

Modified: Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Restarter.pm
===================================================================
--- Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Restarter.pm	2009-04-24 02:06:19 UTC (rev 9812)
+++ Catalyst-Devel/1.00/branches/improved-restarter/lib/Catalyst/Restarter.pm	2009-04-24 02:08:29 UTC (rev 9813)
@@ -91,3 +91,55 @@
 __PACKAGE__->meta->make_immutable;
 
 1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Restarter - Uses Catalyst::Watcher to check for changed files and restart the server
+
+=head1 SYNOPSIS
+
+    my $watcher = Catalyst::Watcher->new(
+        directory => '/path/to/MyApp',
+        regex     => '\.yml$|\.yaml$|\.conf|\.pm$',
+        interval  => 3,
+    );
+
+    while (1) {
+        my @changed_files = $watcher->watch();
+    }
+
+=head1 DESCRIPTION
+
+This class monitors a directory of files for changes made to any file
+matching a regular expression. It correctly handles new files added to the
+application as well as files that are deleted.
+
+=head1 METHODS
+
+=head2 new ( directory => $path [, regex => $regex, delay => $delay ] )
+
+Creates a new Watcher object.
+
+=head2 find_changed_files
+
+Returns a list of files that have been added, deleted, or changed
+since the last time watch was called. Each element returned is a hash
+reference with two keys. The C<file> key contains the filename, and
+the C<status> key contains one of "modified", "added", or "deleted".
+
+=head1 SEE ALSO
+
+L<Catalyst>, L<Catalyst::Restarter>, <File::Modified>
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This program is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut

Added: Catalyst-Devel/1.00/branches/improved-restarter/t/lib/UnknownError.pm
===================================================================
--- Catalyst-Devel/1.00/branches/improved-restarter/t/lib/UnknownError.pm	                        (rev 0)
+++ Catalyst-Devel/1.00/branches/improved-restarter/t/lib/UnknownError.pm	2009-04-24 02:08:29 UTC (rev 9813)
@@ -0,0 +1,8 @@
+# thanks kd
+package UnknownError;
+use strict;
+sub MODIFY_CODE_ATTRIBUTES {}
+sub  check : Blah {
+$error = "please explode" ; # deliberate syntax error
+}
+1;




More information about the Catalyst-commits mailing list