8b0cee51b9525e40cd33d4a24d68c4f42ef960cb
[catagits/Gitalist.git] / lib / Gitalist.pm
1 package Gitalist;
2 use Moose;
3 use namespace::autoclean;
4
5 use Catalyst::Runtime 5.80;
6
7 extends 'Catalyst';
8
9 use Catalyst qw/
10                 ConfigLoader
11                 Static::Simple
12                 StackTrace/;
13
14 our $VERSION = '0.01';
15
16 # Bring in the libified gitweb.cgi.
17 use gitweb;
18
19 __PACKAGE__->config(
20     name => 'Gitalist',
21     default_view => 'Default',
22     default_model => 'Git', # Yes, we are going to be changing this.
23 );
24
25 # Start the application
26 __PACKAGE__->setup();
27
28 around 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 };
38
39 =head1 NAME
40
41 Gitalist - 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
53 L<Gitalist::Controller::Root>, L<Catalyst>
54
55 =head1 AUTHORS AND COPYRIGHT
56
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
63
64 =head1 LICENSE
65
66 FIXME - Is this going to be GPLv2 as per gitweb? If so this is broken..
67
68 This library is free software. You can redistribute it and/or modify
69 it under the same terms as Perl itself.
70
71 =cut
72
73 1;