Fix warning when devel is missing
Marcus Ramberg [Wed, 6 Aug 2008 20:18:37 +0000 (20:18 +0000)]
Changes
lib/Catalyst/Devel.pm
lib/Catalyst/Helper.pm

diff --git a/Changes b/Changes
index d61e61e..5cd5909 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,4 +1,7 @@
 This file documents the revision history for Perl extension Catalyst-Devel.
+
+        - Fix warning when devel is not installed.
+        
 1.08    2008-07-13 18:000
         - Revert to use Catalyst qw/@plugins/
         - Require Config::General instead of YAML
index 99277fc..a0eae81 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 our $VERSION             = '1.08';
-our $CATALYST_SCRIPT_GEN = 31;
+our $CATALYST_SCRIPT_GEN = 32;
 
 =head1 NAME
 
index f298ad8..68632c5 100644 (file)
@@ -1082,7 +1082,18 @@ use strict;
 use warnings;
 use Getopt::Long;
 use Pod::Usage;
-use Catalyst::Helper;
+eval "use Catalyst::Devel;";
+
+if ($@) {
+  die <<END;
+To use the Catalyst development tools including catalyst.pl and the
+generated script/myapp_create.pl you need Catalyst::Helper, which is
+part of the Catalyst-Devel distribution. Please install this via a
+vendor package or by running one of -
+
+  perl -MCPAN -e 'install Catalyst::Devel'
+  perl -MCPANPLUS -e 'install Catalyst::Devel'
+END
 
 my $force = 0;
 my $mech  = 0;