Merge
[catagits/Gitalist.git] / lib / Gitalist.pm
CommitLineData
89de6a33 1package Gitalist;
42fe5d11 2use Moose;
3use namespace::autoclean;
89de6a33 4
5use Catalyst::Runtime 5.80;
6
42fe5d11 7extends 'Catalyst';
89de6a33 8
43d4a724 9use Catalyst qw/
89de6a33 10 ConfigLoader
d5cc37a4 11 Static::Simple
61b56ed6 12 StackTrace/;
13
89de6a33 14our $VERSION = '0.01';
15
4666d5c7 16# Bring in the libified gitweb.cgi.
17use gitweb;
18
d3feefcf 19__PACKAGE__->config(
61b56ed6 20 name => 'Gitalist',
21 default_view => 'Default',
887260eb 22 default_model => 'Git', # Yes, we are going to be changing this.
d3feefcf 23);
89de6a33 24
25# Start the application
26__PACKAGE__->setup();
27
4df2f62f 28around uri_for => sub {
29 my ($orig, $c) = (shift, shift);
30 my $params = Catalyst::Utils::merge_hashes(
31 { p => $c->model('Git')->project },
32 ref($_[-1]) eq 'HASH' ? pop @_ : {}
33 );
34 (my $uri = $c->$orig(@_, $params))
35 =~ tr[&][;];
36 return $uri;
37};
61b56ed6 38
89de6a33 39=head1 NAME
40
41Gitalist - Catalyst based application
42
43=head1 SYNOPSIS
44
45 script/gitalist_server.pl
46
47=head1 DESCRIPTION
48
49[enter your description here]
50
51=head1 SEE ALSO
52
53L<Gitalist::Controller::Root>, L<Catalyst>
54
42fe5d11 55=head1 AUTHORS AND COPYRIGHT
89de6a33 56
42fe5d11 57 Catalyst application:
58 (C) 2009 Venda Ltd and Dan Brook <dbrook@venda.com>
59
60 Original gitweb.cgi from which this was derived:
61 (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
62 (C) 2005, Christian Gierke
89de6a33 63
64=head1 LICENSE
65
42fe5d11 66FIXME - Is this going to be GPLv2 as per gitweb? If so this is broken..
67
89de6a33 68This library is free software. You can redistribute it and/or modify
69it under the same terms as Perl itself.
70
71=cut
72
731;