X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FStatic%2FSimple.pm;h=719a4708774ec09057f9a87500bdf04591647cb0;hb=7e7cdb8e775b76d8ac27830bba82287900bd5ecf;hp=9da679665fe4c72e9aeda8e5bd862f540ab761e2;hpb=d1904f4366c7c3a6d5cb01d3f014afb26148f6ba;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/lib/Catalyst/Plugin/Static/Simple.pm b/lib/Catalyst/Plugin/Static/Simple.pm index 9da6796..719a470 100644 --- a/lib/Catalyst/Plugin/Static/Simple.pm +++ b/lib/Catalyst/Plugin/Static/Simple.pm @@ -9,7 +9,7 @@ use IO::File (); use MIME::Types (); use MRO::Compat; -our $VERSION = '0.22'; +our $VERSION = '0.26'; __PACKAGE__->mk_accessors( qw/_static_file _static_debug_message/ ); @@ -27,10 +27,19 @@ sub prepare_action { # strip trailing slashes, they'll be added in our regex $dir_re =~ s{/$}{}; - my $re = ( $dir =~ m{^qr/}xms ) ? eval $dir : qr{^${dir_re}/}; - if ($@) { - $c->error( "Error compiling static dir regex '$dir': $@" ); + my $re; + + if ( $dir =~ m{^qr/}xms ) { + $re = eval $dir; + + if ($@) { + $c->error( "Error compiling static dir regex '$dir': $@" ); + } + } + else { + $re = qr{^${dir_re}/}; } + if ( $path =~ $re ) { if ( $c->_locate_static_file( $path, 1 ) ) { $c->_debug_msg( 'from static directory' ) @@ -537,7 +546,11 @@ Jesse Sheidlower, Guillermo Roditi, -Florian Ragwitz +Florian Ragwitz, + +Tomas Doran, + +Justin Wheeler (dnm) =head1 THANKS @@ -553,6 +566,12 @@ For the include_path code from Template Toolkit: =head1 COPYRIGHT +Copyright (c) 2005 - 2009 +the Catalyst::Plugin::Static::Simple L and L +as listed above. + +=head1 LICENSE + This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.