pax_global_header00006660000000000000000000000064123706374320014521gustar00rootroot0000000000000052 comment=cfc7c09bb71dd7b6058ee21443215a1fa7c21fec libcatalyst-actionrole-checktrailingslash-perl-0.01/000077500000000000000000000000001237063743200227115ustar00rootroot00000000000000libcatalyst-actionrole-checktrailingslash-perl-0.01/Changes000066400000000000000000000002201237063743200241760ustar00rootroot00000000000000Revision history for Catalyst-ActionRole-CheckTrailingSlash 0.01 Wed 10 Mar 2010 First version, released on an unsuspecting world. libcatalyst-actionrole-checktrailingslash-perl-0.01/MANIFEST000066400000000000000000000002551237063743200240440ustar00rootroot00000000000000Changes lib/Catalyst/ActionRole/CheckTrailingSlash.pm Makefile.PL MANIFEST README t/00-load.t META.yml Module meta-data (added by MakeMaker) libcatalyst-actionrole-checktrailingslash-perl-0.01/META.yml000066400000000000000000000013071237063743200241630ustar00rootroot00000000000000--- #YAML:1.0 name: Catalyst-ActionRole-CheckTrailingSlash version: 0.01 abstract: Test URI path for trailing slash and redirect if needed author: - Anatoliy Lapitskiy license: perl distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 build_requires: ExtUtils::MakeMaker: 0 requires: Catalyst::Controller::ActionRole: 0 Catalyst::Runtime: 5.80 Moose::Role: 0 namespace::autoclean: 0 no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.56 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 libcatalyst-actionrole-checktrailingslash-perl-0.01/Makefile.PL000066400000000000000000000012471237063743200246670ustar00rootroot00000000000000use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Catalyst::ActionRole::CheckTrailingSlash', AUTHOR => 'Anatoliy Lapitskiy ', VERSION_FROM => 'lib/Catalyst/ActionRole/CheckTrailingSlash.pm', LICENSE => 'perl', ABSTRACT_FROM => 'lib/Catalyst/ActionRole/CheckTrailingSlash.pm', PL_FILES => {}, PREREQ_PM => { 'Catalyst::Runtime' => '5.80', 'Moose::Role' => '0', 'namespace::autoclean' => '0', 'Catalyst::Controller::ActionRole' => '0', }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Test-Output-*' }, ); libcatalyst-actionrole-checktrailingslash-perl-0.01/README000066400000000000000000000011101237063743200235620ustar00rootroot00000000000000Catalyst-ActionRole-CheckTrailingSlash This module provides ability to test URI path and do redirect to the URI with trailing slash if needed. INSTALLATION To install this module, run the following commands: perl Makefile.PL make make test make install COPYRIGHT AND LICENCE Copyright (C) 2010 Anatoliy Lapitskiy This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. libcatalyst-actionrole-checktrailingslash-perl-0.01/lib/000077500000000000000000000000001237063743200234575ustar00rootroot00000000000000libcatalyst-actionrole-checktrailingslash-perl-0.01/lib/Catalyst/000077500000000000000000000000001237063743200252435ustar00rootroot00000000000000libcatalyst-actionrole-checktrailingslash-perl-0.01/lib/Catalyst/ActionRole/000077500000000000000000000000001237063743200273025ustar00rootroot00000000000000libcatalyst-actionrole-checktrailingslash-perl-0.01/lib/Catalyst/ActionRole/CheckTrailingSlash.pm000066400000000000000000000041271237063743200333460ustar00rootroot00000000000000package Catalyst::ActionRole::CheckTrailingSlash; use Moose::Role; use namespace::autoclean; our $VERSION = '0.01'; around execute => sub { my $orig = shift; my $self = shift; my ($controller, $c) = @_; my $uri = $c->req->uri; if ( $uri->path !~ m{/$} ) { $uri->path( $uri->path.'/' ); $c->res->redirect( $uri, 301 ); return; } $self->$orig( @_ ); }; 1; =head1 NAME Catalyst::ActionRole::CheckTrailingSlash - Test URI path for trailing slash and redirect if needed =cut =head1 SYNOPSIS package MyApp::Controller::Root use Moose; BEGIN { extends 'Catalyst::Controller::ActionRole' }; sub info :Local :Does('CheckTrailingSlash') { my ( $self, $c ) = @_; ... } ... =cut =head1 AUTHOR Anatoliy Lapitskiy, C<< >> =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc Catalyst::ActionRole::CheckTrailingSlash You can also look for information at: =over 4 =item * RT: CPAN's request tracker L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =item * Search CPAN L =back =head1 ACKNOWLEDGEMENTS =head1 COPYRIGHT & LICENSE Copyright 2010 Anatoliy Lapitskiy. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. =cut libcatalyst-actionrole-checktrailingslash-perl-0.01/t/000077500000000000000000000000001237063743200231545ustar00rootroot00000000000000libcatalyst-actionrole-checktrailingslash-perl-0.01/t/00-load.t000066400000000000000000000003511237063743200244740ustar00rootroot00000000000000#!perl -T use Test::More tests => 1; BEGIN { use_ok( 'Catalyst::ActionRole::CheckTrailingSlash' ); } diag( "Testing Catalyst::ActionRole::CheckTrailingSlash $Catalyst::ActionRole::CheckTrailingSlash::VERSION, Perl $], $^X" );