X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=1068f27a5e14180945e32ec485df3b68438d761f;hb=1b1636b58ce5f1feabd0d125c3928c57e5a5cf3c;hp=4fe18e78bead702b460a4624e3fc21e01c917613;hpb=e80e8542290e1c62b3c6dbee4265691d7ad634c3;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 4fe18e7..1068f27 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -50,9 +50,6 @@ our $DETACH = "catalyst_detach\n"; require Module::Pluggable::Fast; -# Helper script generation -our $CATALYST_SCRIPT_GEN = 27; - __PACKAGE__->mk_classdata($_) for qw/components arguments dispatcher engine log dispatcher_class engine_class context_class request_class response_class setup_finished/; @@ -105,7 +102,7 @@ Catalyst - The Elegant MVC Web Application Framework ### in lib/MyApp.pm use Catalyst qw/-Debug/; # include plugins here as well - ### In libMyApp/Controller/Root.pm (autocreated) + ### In lib/MyApp/Controller/Root.pm (autocreated) sub foo : Global { # called for /foo, /foo/1, /foo/1/2, etc. my ( $self, $c, @args ) = @_; # args are qw/1 2/ for /foo/1/2 $c->stash->{template} = 'foo.tt'; # set the template @@ -779,8 +776,9 @@ sub setup { } } - $class->log->warn( - <<"EOF") if ( $ENV{CATALYST_SCRIPT_GEN} && ( $ENV{CATALYST_SCRIPT_GEN} < $Catalyst::CATALYST_SCRIPT_GEN ) ); + eval { require Catalyst::Devel; }; + if( !$@ && $ENV{CATALYST_SCRIPT_GEN} && ( $ENV{CATALYST_SCRIPT_GEN} < $Catalyst::Devel::CATALYST_SCRIPT_GEN ) ) { + $class->log->warn(<<"EOF"); You are running an old script! Please update by running (this will overwrite existing files): @@ -789,7 +787,8 @@ You are running an old script! or (this will not overwrite existing files): catalyst.pl -scripts $class EOF - + } + if ( $class->debug ) { my @plugins = ();