Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Should be everything, appears working at least..
- Loading branch information
0 parents
commit 019a8a6
Showing
15 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cover_db | ||
META.yml | ||
Makefile | ||
blib | ||
inc | ||
pm_to_blib | ||
MANIFEST | ||
Makefile.old | ||
CatalystX-Debug-ResponseHeaders-* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
0.001 2010-03-28 | ||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.git/ | ||
blib | ||
pm_to_blib | ||
MANIFEST.bak | ||
MANIFEST.SKIP~ | ||
cover_db | ||
Makefile$ | ||
Makefile.old$ | ||
^CatalystX-Debug-ResponseHeaders- | ||
^.gitignore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use strict; | ||
use warnings; | ||
use inc::Module::Install 0.91; | ||
use Module::Install::AuthorRequires; | ||
use Module::Install::AuthorTests; | ||
|
||
name 'CatalystX-Debug-ResponseHeaders'; | ||
all_from 'lib/CatalystX/Debug/ResponseHeaders.pm'; | ||
|
||
requires 'Moose'; | ||
requires 'namespace::autoclean'; | ||
|
||
build_requires 'Catalyst::Runtime' => '5.80015'; | ||
build_requires 'Test::WWW::Mechanize::Catalyst'; | ||
build_requires 'Test::More' => '0.88'; | ||
|
||
author_requires 'Test::Pod::Coverage' => '1.04'; | ||
author_requires 'Test::Pod' => '1.14'; | ||
|
||
author_tests 't/author'; | ||
|
||
resources repository => 'git://somewhere.com/myproject.git'; | ||
|
||
if ($Module::Install::AUTHOR) { | ||
system("pod2text lib/CatalystX/Debug/ResponseHeaders.pm > README") | ||
and die $!; | ||
} | ||
|
||
WriteAll(); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package CatalystX::Debug::ResponseHeaders; | ||
use Moose; | ||
use namespace::autoclean; | ||
|
||
our $VERSION = '0.001'; | ||
|
||
requires 'log_response_headers'; | ||
|
||
around log_response_headers => sub { | ||
my $orig = shift; | ||
my $c = shift; | ||
my $headers = shift; # an HTTP::Headers instance | ||
|
||
return unless $c->debug; | ||
|
||
$c->log_headers('response', $headers); | ||
}; | ||
|
||
|
||
1; | ||
|
||
=head1 NAME | ||
CatalystX::Debug::ResponseHeaders - | ||
=head1 DESCRIPTION | ||
=head1 METHODS | ||
=head1 BUGS | ||
=head1 AUTHOR | ||
=head1 COPYRIGHT & LICENSE | ||
Copyright 2009 the above author(s). | ||
This sofware is free software, and is licensed under the same terms as perl itself. | ||
=cut | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use_ok 'CatalystX::Debug::ResponseHeaders'; | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use Test::Pod::Coverage 1.04; | ||
all_pod_coverage_ok(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use Test::Pod 1.14; | ||
all_pod_files_ok(); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package TestApp; | ||
use Moose; | ||
use namespace::autoclean; | ||
|
||
use Catalyst qw/ | ||
+CatalystX::Debug::ResponseHeaders | ||
/; | ||
|
||
extends 'Catalyst'; | ||
|
||
__PACKAGE__->setup; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package TestApp::Controller::Root; | ||
use Moose; | ||
use namespace::autoclean; | ||
|
||
BEGIN { extends 'Catalyst::Controller' } | ||
|
||
__PACKAGE__->config(namespace => q{}); | ||
|
||
sub base : Chained('/') PathPart('') CaptureArgs(0) {} | ||
|
||
# your actions replace this one | ||
sub main : Chained('base') PathPart('') Args(0) { | ||
my ($self, $ctx) = @_; | ||
$ctx->res->body('<h1>It works</h1>'); | ||
} | ||
|
||
__PACKAGE__->meta->make_immutable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env perl | ||
|
||
BEGIN { | ||
$ENV{CATALYST_SCRIPT_GEN} = 40; | ||
} | ||
|
||
use Catalyst::ScriptRunner; | ||
Catalyst::ScriptRunner->run('TestApp', 'Server'); | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use FindBin; | ||
use lib "$FindBin::Bin/.."; | ||
use Catalyst::Test 'TestApp'; | ||
|
||
print request($ARGV[0])->content . "\n"; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
|
||
# setup library path | ||
use FindBin qw($Bin); | ||
use lib "$Bin/lib"; | ||
|
||
# make sure testapp works | ||
use ok 'TestApp'; | ||
|
||
# a live test against TestApp, the test application | ||
use Test::WWW::Mechanize::Catalyst 'TestApp'; | ||
my $mech = Test::WWW::Mechanize::Catalyst->new; | ||
$mech->get_ok('http://localhost/', 'get main page'); | ||
$mech->content_like(qr/it works/i, 'see if it has our text'); | ||
|
||
done_testing; |