C::C::CGIBin: add root/cgi-bin to $c->config->{static}{ignore_dirs}
Rafael Kitover [Fri, 9 Jan 2009 23:08:26 +0000 (23:08 +0000)]
Changes
META.yml
Makefile.PL
lib/Catalyst/Controller/CGIBin.pm
lib/Catalyst/Controller/WrapCGI.pm
t/lib/TestCGIBin.pm

diff --git a/Changes b/Changes
index 7d700a5..3986d0d 100644 (file)
--- a/Changes
+++ b/Changes
@@ -8,3 +8,9 @@ Revision history for Catalyst-Controller-WrapCGI
 
 0.0022  2008-07-04 02:52:52
     Fixed test shell script portability and missing dep on Class::C3
+
+0.0024  2008-11-19 16:00:54
+    Fixed for Catalyst 5.8
+
+0.0025  2009-01-09 14:59:20
+    Tell Static::Simple to ignore root/cgi-bin for C::C::CGIBin
index 8522772..429ce06 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -3,6 +3,7 @@ abstract: 'Run CGIs in Catalyst'
 author:
   - 'Matt S. Trout <mst@shadowcat.co.uk>'
 build_requires:
+  Catalyst::Plugin::Static::Simple: 0
   Test::More: 0
 distribution_type: module
 generated_by: 'Module::Install version 0.77'
@@ -27,4 +28,4 @@ requires:
   parent: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.0024
+version: 0.0025
index 436b630..ef11a4e 100644 (file)
@@ -3,6 +3,7 @@ use inc::Module::Install;
 name     'Catalyst-Controller-WrapCGI';
 all_from 'lib/Catalyst/Controller/WrapCGI.pm';
 author   'Matt S. Trout <mst@shadowcat.co.uk>';
+include  'Module::AutoInstall';
 
 requires 'Catalyst' => '5.7007';
 requires 'Class::C3';
@@ -14,6 +15,8 @@ requires 'File::Find::Rule';
 requires 'List::MoreUtils';
 requires 'File::Slurp';
 
+test_requires 'Catalyst::Plugin::Static::Simple';
+
 build_requires 'Test::More';
 
 auto_install;
index 88dec28..c911905 100644 (file)
@@ -4,7 +4,6 @@ use strict;
 use warnings;
 
 use Class::C3;
-use URI::Escape;
 use File::Slurp 'slurp';
 use File::Find::Rule ();
 use Catalyst::Exception ();
@@ -13,6 +12,7 @@ use IPC::Open3;
 use Symbol 'gensym';
 use List::MoreUtils 'any';
 use IO::File ();
+use namespace::clean -except => 'meta';
 
 use parent 'Catalyst::Controller::WrapCGI';
 
@@ -22,11 +22,11 @@ Catalyst::Controller::CGIBin - Serve CGIs from root/cgi-bin
 
 =head1 VERSION
 
-Version 0.003
+Version 0.004
 
 =cut
 
-our $VERSION = '0.003';
+our $VERSION = '0.004';
 
 =head1 SYNOPSIS
 
@@ -123,6 +123,11 @@ sub register_actions {
     }
 
     $self->next::method($app, @_);
+
+# Tell Static::Simple to ignore the cgi-bin dir.
+    if (!any{ $_ eq 'cgi-bin' } @{ $app->config->{static}{ignore_dirs}||[] }) {
+        push @{ $app->config->{static}{ignore_dirs} }, 'cgi-bin';
+    }
 }
 
 =head1 METHODS
index b083148..71b3592 100644 (file)
@@ -15,11 +15,11 @@ Catalyst::Controller::WrapCGI - Run CGIs in Catalyst
 
 =head1 VERSION
 
-Version 0.0024
+Version 0.0025
 
 =cut
 
-our $VERSION = '0.0024';
+our $VERSION = '0.0025';
 
 =head1 SYNOPSIS
 
index a29e685..bfe8eaf 100644 (file)
@@ -3,6 +3,6 @@ package TestCGIBin;
 use Catalyst::Runtime '5.70';
 use parent 'Catalyst';
 
-__PACKAGE__->setup;
+__PACKAGE__->setup(qw/Static::Simple/);
 
 1;