Commit | Line | Data |
89de6a33 |
1 | package Gitalist::Controller::Root; |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use 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 | |
15 | Gitalist::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 | |
89de6a33 |
29 | use IO::Capture::Stdout; |
d3feefcf |
30 | |
89de6a33 |
31 | sub default :Path { |
32 | my ( $self, $c ) = @_; |
33 | |
34 | my $capture = IO::Capture::Stdout->new(); |
35 | $capture->start(); |
3d8f28d7 |
36 | eval { |
37 | my $action = gitweb::main($c); |
38 | $action->(); |
39 | }; |
89de6a33 |
40 | $capture->stop(); |
41 | |
3d8f28d7 |
42 | gitweb::git_header_html(); |
43 | gitweb::git_footer_html(); |
89de6a33 |
44 | my $output = join '', $capture->read; |
194fa4ff |
45 | $c->stash->{content} = $output |
46 | unless $c->stash->{content}; |
d3feefcf |
47 | $c->stash->{template} = 'default.tt2'; |
89de6a33 |
48 | } |
49 | |
50 | =head2 end |
51 | |
52 | Attempt to render a view, if needed. |
53 | |
54 | =cut |
55 | |
56 | sub end : ActionClass('RenderView') {} |
57 | |
58 | =head1 AUTHOR |
59 | |
60 | Dan Brook,,, |
61 | |
62 | =head1 LICENSE |
63 | |
64 | This library is free software. You can redistribute it and/or modify |
65 | it under the same terms as Perl itself. |
66 | |
67 | =cut |
68 | |
69 | 1; |