merge from trunk
Dave Rolsky [Fri, 24 Apr 2009 02:08:29 +0000 (02:08 +0000)]
.gitignore [new file with mode: 0644]
Changes
MANIFEST.SKIP
Makefile.PL
lib/Catalyst/Devel.pm
lib/Catalyst/Restarter.pm
t/lib/UnknownError.pm [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..b564fdd
--- /dev/null
@@ -0,0 +1,15 @@
+.*
+!.gitignore
+Makefile*
+!Makefile.PL
+META.yml
+blib
+build
+inc
+pm_to_blib
+MANIFEST*
+!MANIFEST.SKIP
+Debian*
+README
+Catalyst-Devel-*
+*.bs
diff --git a/Changes b/Changes
index 774533a..29d5170 100644 (file)
--- a/Changes
+++ b/Changes
@@ -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 @@ This file documents the revision history for Perl extension Catalyst-Devel.
         - 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 @@ This file documents the revision history for Perl extension Catalyst-Devel.
         - 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@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 @@ This file documents the revision history for Perl extension Catalyst-Devel.
         - 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
index c62cf44..738fe86 100644 (file)
@@ -3,6 +3,7 @@
 \bCVS\b
 ,v$
 \B\.svn\b
+\B\.git
 
 # Avoid Makemaker generated and utility files.
 \bMakefile$
index b57759f..eccfd2a 100644 (file)
@@ -15,6 +15,48 @@ requires 'parent'; # as of 1.04
 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;
index d3d1903..8212972 100644 (file)
@@ -3,7 +3,7 @@ package Catalyst::Devel;
 use strict;
 use warnings;
 
-our $VERSION             = '1.10';
+our $VERSION             = '1.11';
 our $CATALYST_SCRIPT_GEN = 33;
 
 =head1 NAME
index a31c638..33b3d17 100644 (file)
@@ -91,3 +91,55 @@ sub DEMOLISH {
 __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
diff --git a/t/lib/UnknownError.pm b/t/lib/UnknownError.pm
new file mode 100644 (file)
index 0000000..c14415b
--- /dev/null
@@ -0,0 +1,8 @@
+# thanks kd
+package UnknownError;
+use strict;
+sub MODIFY_CODE_ATTRIBUTES {}
+sub  check : Blah {
+$error = "please explode" ; # deliberate syntax error
+}
+1;