0.0028 2009-04-24 04:40:39
Add support for __DATA__ sections in cgis for C::CGIBin
+
+0.0029
+ Allow more control over public paths to CGIBin actions.
my $path = join '/' => splitdir($cgi_path);
my $action_name = $self->cgi_action($path);
+ my $public_path = $self->cgi_path($path);
my $reverse = $namespace ? "$namespace/$action_name" : $action_name;
- my $attrs = { Path => [ "cgi-bin/$path" ], Args => [ 0 ] };
+ my $attrs = { Path => [ $public_path ], Args => [ 0 ] };
my ($cgi, $type);
=head1 METHODS
-=head2 $self->cgi_action($cgi_path)
+=head2 $self->cgi_action($cgi)
Takes a path to a CGI from C<root/cgi-bin> such as C<foo/bar.cgi> and returns
the action name it is registered as. See L</DESCRIPTION> for a discussion on how
$action_name
}
+=head2 $self->cgi_path($cgi)
+
+Takes a path to a CGI from C<root/cgi-bin> such as C<foo/bar.cgi> and returns
+the public path it should be registered under.
+
+The default is C<cgi-bin/$cgi>.
+
+=cut
+
+sub cgi_path {
+ my ($self, $cgi) = @_;
+ return "cgi-bin/$cgi";
+}
+
=head2 $self->is_perl_cgi($path)
Tries to figure out whether the CGI is Perl or not.
# this should be ignored
$ENV{MOD_PERL} = "mod_perl/2.0";
-my $response = request POST '/cgi-bin/path/test.pl', [
+my $response = request POST '/my-bin/path/test.pl', [
foo => 'bar',
bar => 'baz'
];
skip "Can't run shell scripts on non-*nix", 1
if $^O eq 'MSWin32' || $^O eq 'VMS';
- is(get('/cgi-bin/test.sh'), "Hello!\n", 'Non-Perl CGI File');
+ is(get('/my-bin/test.sh'), "Hello!\n", 'Non-Perl CGI File');
}