From: Rafael Kitover Date: Fri, 9 Jan 2009 23:08:26 +0000 (+0000) Subject: C::C::CGIBin: add root/cgi-bin to $c->config->{static}{ignore_dirs} X-Git-Tag: 0.030~56 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-WrapCGI.git;a=commitdiff_plain;h=2340af9d7778ff7ed8e40289015463570ed09c6e C::C::CGIBin: add root/cgi-bin to $c->config->{static}{ignore_dirs} --- diff --git a/Changes b/Changes index 7d700a5..3986d0d 100644 --- 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 diff --git a/META.yml b/META.yml index 8522772..429ce06 100644 --- a/META.yml +++ b/META.yml @@ -3,6 +3,7 @@ abstract: 'Run CGIs in Catalyst' author: - 'Matt S. Trout ' 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 diff --git a/Makefile.PL b/Makefile.PL index 436b630..ef11a4e 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,6 +3,7 @@ use inc::Module::Install; name 'Catalyst-Controller-WrapCGI'; all_from 'lib/Catalyst/Controller/WrapCGI.pm'; author 'Matt S. Trout '; +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; diff --git a/lib/Catalyst/Controller/CGIBin.pm b/lib/Catalyst/Controller/CGIBin.pm index 88dec28..c911905 100644 --- a/lib/Catalyst/Controller/CGIBin.pm +++ b/lib/Catalyst/Controller/CGIBin.pm @@ -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 diff --git a/lib/Catalyst/Controller/WrapCGI.pm b/lib/Catalyst/Controller/WrapCGI.pm index b083148..71b3592 100644 --- a/lib/Catalyst/Controller/WrapCGI.pm +++ b/lib/Catalyst/Controller/WrapCGI.pm @@ -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 diff --git a/t/lib/TestCGIBin.pm b/t/lib/TestCGIBin.pm index a29e685..bfe8eaf 100644 --- a/t/lib/TestCGIBin.pm +++ b/t/lib/TestCGIBin.pm @@ -3,6 +3,6 @@ package TestCGIBin; use Catalyst::Runtime '5.70'; use parent 'Catalyst'; -__PACKAGE__->setup; +__PACKAGE__->setup(qw/Static::Simple/); 1;