From: Sebastian Riedel Date: Mon, 6 Jun 2005 21:19:04 +0000 (+0000) Subject: Fixed scripts on win32 X-Git-Tag: 5.7099_04~1336 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=8e7b8bc309b0a08ed4491ddab3179dae28026c7d Fixed scripts on win32 --- diff --git a/Changes b/Changes index fc59a38..09af973 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,8 @@ This file documents the revision history for Perl extension Catalyst. 5.23 2005-06-03 02:30:00 - added support for non Catalyst::Base components to live in namespace - improved concurrency connections in Catalyst::Engine::HTTP::Daemon + - win32 compatibility for scripts (Andy Grundman) + IMPORTANT: You have to regenerate the script directory! 5.22 2005-05-26 14:24:00 - Improved base locating in MP engines diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index e8ad1d5..3d72db5 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -528,11 +528,16 @@ plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; all_pod_coverage_ok(); __cgi__ [% startperl %] -w -BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' } use strict; use FindBin; -use lib "$FindBin::Bin/../lib"; +use Path::Class; + +BEGIN { + $ENV{CATALYST_ENGINE} ||= 'CGI'; + use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify; +} + use [% name %]; [% name %]->run; @@ -566,11 +571,15 @@ it under the same terms as perl itself. __fastcgi__ [% startperl %] -w -BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' } - use strict; use FindBin; -use lib "$FindBin::Bin/../lib"; +use Path::Class; + +BEGIN { + $ENV{CATALYST_ENGINE} ||= 'FastCGI'; + use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify; +} + use [% name %]; [% name %]->run; @@ -604,16 +613,18 @@ it under the same terms as perl itself. __server__ [% startperl %] -w -BEGIN { - $ENV{CATALYST_ENGINE} ||= 'HTTP'; - $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %]; -} - use strict; use Getopt::Long; use Pod::Usage; use FindBin; -use lib "$FindBin::Bin/../lib"; +use Path::Class; + +BEGIN { + $ENV{CATALYST_ENGINE} ||= 'HTTP'; + $ENV{CATALYST_SCRIPT_GEN} = [% scriptgen %]; + use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify; +} + use [% name %]; my $help = 0; @@ -662,13 +673,17 @@ it under the same terms as perl itself. __test__ [% startperl %] -w -BEGIN { $ENV{CATALYST_ENGINE} ||= 'Test' } - use strict; use Getopt::Long; use Pod::Usage; use FindBin; -use lib "$FindBin::Bin/../lib"; +use Path::Class; + +BEGIN { + $ENV{CATALYST_ENGINE} ||= 'Test'; + use lib dir($FindBin::Bin)->parent->subdir('lib')->stringify; +} + use [% name %]; my $help = 0;