Switched to Module::Install
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Streaming.pm
CommitLineData
fbcc39ad 1package TestApp::Controller::Action::Streaming;
2
3use strict;
4use base 'TestApp::Controller::Action';
5
6sub streaming : Global {
7 my ( $self, $c ) = @_;
8 for my $line ( split "\n", <<'EOF' ) {
9foo
10bar
11baz
12EOF
13 $c->res->write("$line\n");
14 }
15}
16
3dc4d7e9 17sub body : Local {
18 my ( $self, $c ) = @_;
19
20 my $file = "$FindBin::Bin/../../../../01use.t";
21 my $fh = IO::File->new( $file, 'r' );
22 if ( defined $fh ) {
23 $c->res->body( $fh );
24 }
25 else {
26 $c->res->body( "Unable to read $file" );
27 }
28}
29
fbcc39ad 301;