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