Kinda merge legacy uri thing
[catagits/Gitalist.git] / lib / Gitalist / Controller / LegacyURI.pm
1 package Gitalist::Controller::LegacyURI;
2 use Moose;
3 use Moose::Autobox;
4 use namespace::autoclean;
5
6 BEGIN { extends 'Gitalist::Controller' }
7
8 sub handler : Chained('/base') PathPart('legacy') Args() {
9     die("Not supported");
10 }
11
12 sub repository_index : Chained('/base') Args(0) {
13       my ( $self, $c ) = @_;
14
15       $c->response->content_type('text/plain');
16       $c->response->body(
17           join "\n", map $_->name, $c->model()->repositories->flatten
18       ) or die 'No repositories found in '. $c->model->repo_dir;
19 }
20
21 __PACKAGE__->meta->make_immutable;