Added the Catalyst app Gitalist with gitweb.cgi shim.
[catagits/Gitalist.git] / Gitalist / lib / Gitalist / Controller / Root.pm
CommitLineData
89de6a33 1package Gitalist::Controller::Root;
2
3use strict;
4use warnings;
5use parent 'Catalyst::Controller';
6
7#
8# Sets the actions in this controller to be registered with no prefix
9# so they function identically to actions created in MyApp.pm
10#
11__PACKAGE__->config->{namespace} = '';
12
13=head1 NAME
14
15Gitalist::Controller::Root - Root Controller for Gitalist
16
17=head1 DESCRIPTION
18
19[enter your description here]
20
21=head1 METHODS
22
23=cut
24
25=head2 index
26
27=cut
28
29#sub index :Path :Args(0) {
30# my ( $self, $c ) = @_;
31#
32# # Hello World
33# $c->response->body( $c->welcome_message );
34#}
35
36use IO::Capture::Stdout;
37sub default :Path {
38 my ( $self, $c ) = @_;
39
40 my $capture = IO::Capture::Stdout->new();
41 $capture->start();
42 eval { gitweb::main() };
43 $capture->stop();
44
45 my $output = join '', $capture->read;
46 $output =~ s/\A.*?\r?\n\r?\n//s;
47 $c->response->body( $output );
48}
49
50=head2 end
51
52Attempt to render a view, if needed.
53
54=cut
55
56sub end : ActionClass('RenderView') {}
57
58=head1 AUTHOR
59
60Dan Brook,,,
61
62=head1 LICENSE
63
64This library is free software. You can redistribute it and/or modify
65it under the same terms as Perl itself.
66
67=cut
68
691;