Fixed: Minor typo in Intro.pod
Marcus Ramberg [Fri, 15 Apr 2005 12:56:32 +0000 (12:56 +0000)]
Added: Support for script generations
Fixed: report correct class in abstract Base::process

lib/Catalyst.pm
lib/Catalyst/Base.pm
lib/Catalyst/Helper.pm
lib/Catalyst/Manual/Intro.pod

index e7cc9a9..829f72b 100644 (file)
@@ -4,6 +4,7 @@ use strict;
 use base 'Catalyst::Base';
 use UNIVERSAL::require;
 use Catalyst::Log;
+use Catalyst::Helper;
 use Text::ASCIITable;
 
 __PACKAGE__->mk_classdata($_) for qw/dispatcher engine log/;
@@ -133,7 +134,7 @@ sub import {
     }
 
     if ( $caller->engine ) {
-        return;    # Catalyst is allready initialized
+        return;    # Catalyst is already initialized
     }
 
     unless ( $caller->log ) {
@@ -163,6 +164,12 @@ sub import {
         }
     }
 
+    $caller->log->info("You are running an old helper script! ".
+             "Please update your scripts by regenerating the ".
+             "application and copying over the new scripts.")
+        if ( $ENV{CATALYST_SCRIPT_GEN} && ( 
+             $ENV{CATALYST_SCRIPT_GEN} < 
+             $Catalyst::Helper::CATALYST_SCRIPT_GEN )) ;
     # Process options
     my @plugins;
     foreach (@options) {
index 1e1d585..a79cfa2 100644 (file)
@@ -95,7 +95,7 @@ sub config {
 
 =cut
 
-sub process { die __PACKAGE__." did not override process."; }
+sub process { die ((ref $_[0] || $_[0])." did not override Catalyst::Base::process"); }
 
 =back
 
index 8dab1c3..f4f2110 100644 (file)
@@ -8,6 +8,7 @@ use File::Path;
 use IO::File;
 use FindBin;
 use Template;
+our $CATALYST_SCRIPT_GEN = 2;
 
 my %cache;
 
@@ -58,6 +59,7 @@ sub mk_app {
     $self->{dir}  = $name;
     $self->{dir} =~ s/\:\:/-/g;
     $self->{startperl} = $Config{startperl};
+    $self->{scriptgen}=$CATALYST_SCRIPT_GEN;
     $self->_mk_dirs;
     $self->_mk_appclass;
     $self->_mk_makefile;
@@ -535,7 +537,10 @@ the same terms as perl itself.
 __server__
 [% startperl %] -w
 
-BEGIN { $ENV{CATALYST_ENGINE} = 'HTTP' }
+BEGIN { 
+    $ENV{CATALYST_ENGINE} = 'HTTP';
+    $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %];
+}  
 
 use strict;
 use Getopt::Long;
index 407daa7..28a08d6 100644 (file)
@@ -339,7 +339,7 @@ but before your action is processed.
 
   MyApp::begin
   MyApp::auto
-  MyApp::default
+  MyApp::C::Foo::default
   MyApp::end
 
 =item for a request for /foo/bar/foo