requires 'Sys::Hostname';
requires 'XML::Atom';
requires 'XML::RSS';
+requires 'XML::OPML::SimpleGen';
author_requires 'Test::NoTabs';
author_requires 'Test::Pod' => '1.14';
use XML::Atom::Feed;
use XML::Atom::Entry;
use XML::RSS;
+use XML::OPML::SimpleGen;
=head1 NAME
$c->response->status(200);
}
+sub opml : Local {
+ my($self, $c) = @_;
+
+ my $opml = XML::OPML::SimpleGen->new();
+
+ $opml->head(title => lc(Sys::Hostname::hostname()) . ' - ' . Gitalist->config->{name});
+
+ my @list = @{ $c->model()->projects };
+ die 'No projects found in '. $c->model->repo_dir
+ unless @list;
+
+ for my $proj ( @list ) {
+ $opml->insert_outline(
+ text => $proj->name. ' - '. $proj->description,
+ xmlUrl => $c->uri_for(rss => {p => $proj->name}),
+ );
+ }
+
+ $c->response->body($opml->as_string);
+ $c->response->content_type('application/rss');
+ $c->response->status(200);
+}
+
=head2 patch
A raw patch for a given commit.
);
}
-sub opml : Local {
- # FIXME - implement snapshot
- Carp::croak "Not implemented.";
-}
-
=head2 end
Attempt to render a view, if needed.
test('/', 'a=project_index');
-TODO: {
- local $TODO = 'The opml action is yet to be implemented';
- test('/', 'a=opml');
-}
+test('/', 'a=opml');
test('/', 'a=blame;f=dir1/file2;hb=36c6c6708b8360d7023e8a1649c45bcf9b3bd818');
test('/', 'a=blame;f=file1;h=257cc5642cb1a054f08cc83f2d943e56fd3ebe99;hb=3bc0634310b9c62222bb0e724c11ffdfb297b4ac');