A rough cut of the /search action.
[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/-Debug
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 );
23
24 # Start the application
25 __PACKAGE__->setup();
26
27 around uri_for => sub {
28   my ($orig, $c) = (shift, shift);
29   my $params = Catalyst::Utils::merge_hashes(
30     { p => $c->model('Git')->project },
31     ref($_[-1]) eq 'HASH' ? pop @_ : {}
32   );
33   (my $uri = $c->$orig(@_, $params))
34     =~ tr[&][;];
35   return $uri;
36 };
37
38 =head1 NAME
39
40 Gitalist - Catalyst based application
41
42 =head1 SYNOPSIS
43
44     script/gitalist_server.pl
45
46 =head1 DESCRIPTION
47
48 [enter your description here]
49
50 =head1 SEE ALSO
51
52 L<Gitalist::Controller::Root>, L<Catalyst>
53
54 =head1 AUTHORS AND COPYRIGHT
55
56   Catalyst application:
57     (C) 2009 Venda Ltd and Dan Brook <dbrook@venda.com>
58
59   Original gitweb.cgi from which this was derived:
60     (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
61     (C) 2005, Christian Gierke
62
63 =head1 LICENSE
64
65 FIXME - Is this going to be GPLv2 as per gitweb? If so this is broken..
66
67 This library is free software. You can redistribute it and/or modify
68 it under the same terms as Perl itself.
69
70 =cut
71
72 1;