Static::Simple 0.13, fixed win32 bug in ignore_dirs v0.13
Andy Grundman [Thu, 15 Dec 2005 14:45:08 +0000 (14:45 +0000)]
Changes
META.yml
lib/Catalyst/Plugin/Static/Simple.pm

diff --git a/Changes b/Changes
index 9fc2c71..981130e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,9 @@
 Revision history for Perl extension Catalyst::Plugin::Static::Simple
 
-0.12
+0.13    2005-12-15 10:00:00
+        - Fixed bug in ignore_dirs under win32.
+
+0.12    (released only with Catalyst)
         - Made prepare_action play nice with other plugins by not short-
           circuiting.
         - Added tmpl to the ignored extensions.
index 2eabff5..b7418c3 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,6 +1,6 @@
 ---
 name: Catalyst-Plugin-Static-Simple
-version: 0.12
+version: 0.13
 author:
   - 'Andy Grundman, <andy@hybridized.org>'
 abstract: Make serving static pages painless.
@@ -11,5 +11,5 @@ requires:
 provides:
   Catalyst::Plugin::Static::Simple:
     file: lib/Catalyst/Plugin/Static/Simple.pm
-    version: 0.12
-generated_by: Module::Build version 0.26
+    version: 0.13
+generated_by: Module::Build version 0.2611
index 827c272..fedd309 100644 (file)
@@ -9,7 +9,7 @@ use IO::File;
 use MIME::Types;
 use NEXT;
 
-our $VERSION = '0.12';
+our $VERSION = '0.13';
 
 __PACKAGE__->mk_classdata( qw/_static_mime_types/ );
 __PACKAGE__->mk_accessors( qw/_static_file
@@ -130,13 +130,13 @@ sub _locate_static_file {
                 next DIR_CHECK;
             }
         } else {
-            $dir =~ s/\/$//xms;
+            $dir =~ s/(\/|\\)$//xms;
             if ( -d $dir && -f $dir . '/' . $path ) {
                 
                 # do we need to ignore the file?
                 for my $ignore ( @{ $c->config->{static}->{ignore_dirs} } ) {
-                    $ignore =~ s{/$}{};
-                    if ( $path =~ /^$ignore\// ) {
+                    $ignore =~ s{(/|\\)$}{};
+                    if ( $path =~ /^$ignore(\/|\\)/ ) {
                         $c->_debug_msg( "Ignoring directory `$ignore`" )
                             if ( $c->config->{static}->{debug} );
                         next DIR_CHECK;