Kinda merge legacy uri thing
Tomas Doran [Tue, 2 Feb 2010 02:19:52 +0000 (02:19 +0000)]
lib/Gitalist/Controller/LegacyURI.pm

index 95289ff..07f338d 100644 (file)
@@ -1,5 +1,6 @@
 package Gitalist::Controller::LegacyURI;
 use Moose;
+use Moose::Autobox;
 use namespace::autoclean;
 
 BEGIN { extends 'Gitalist::Controller' }
@@ -8,4 +9,13 @@ sub handler : Chained('/base') PathPart('legacy') Args() {
     die("Not supported");
 }
 
+sub repository_index : Chained('/base') Args(0) {
+      my ( $self, $c ) = @_;
+
+      $c->response->content_type('text/plain');
+      $c->response->body(
+          join "\n", map $_->name, $c->model()->repositories->flatten
+      ) or die 'No repositories found in '. $c->model->repo_dir;
+}
+
 __PACKAGE__->meta->make_immutable;