Remove gitweb.cgi, this is no longer needed
[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                 Unicode::Encoding
12                 Static::Simple
13                 StackTrace
14 /;
15
16 our $VERSION = '0.01';
17
18 __PACKAGE__->config(
19     name => 'Gitalist',
20     default_view => 'Default',
21     default_model => 'GitRepos',
22 );
23
24 # Start the application
25 __PACKAGE__->setup();
26
27 around uri_for => sub {
28   my ($orig, $c) = (shift, shift);
29   my $project_name = $c->stash->{'Project'} && $c->stash->{'Project'}->name;
30   my $hash = ref($_[-1]) eq 'HASH' ? pop @_ : {};
31   my $params = Catalyst::Utils::merge_hashes(
32     { p => $hash->{p} || $project_name },
33     $hash,
34   );
35   delete $params->{p} unless defined $params->{p} && length $params->{p};
36   (my $uri = $c->$orig(@_, $params))
37     =~ tr[&][;];
38   return $uri;
39 };
40
41 =head1 NAME
42
43 Gitalist - Transitional project to convert gitweb.cgi to a Catalyst app
44
45 =head1 SYNOPSIS
46
47     script/gitalist_server.pl
48
49
50 =head1 INSTALL
51
52 As Gitalist follows the usual Perl module format the usual approach
53 for installation should work e.g
54
55   perl Makefile.PL
56   make
57   make test
58   make install
59
60 If you're running a git checkout of Gitalist then you'll additionally
61 need the author modules. I<NB: As no distribution exists one will
62 presently need the author modules>.
63
64 =head1 DESCRIPTION
65
66 Gitalist is a web frontend for git repositories based on gitweb.cgi
67 and backed by Catalyst. It doesn't yet have the full functionality of
68 gitweb.cgi but it does have a few small additions at this stage.
69
70 =head2 History
71
72 This project started off as an attempt to port gitweb.cgi to a
73 Catalyst app in a piecemeal fashion. As it turns out, thanks largely
74 to Florian Ragwitz's earlier effort, it was easier to use gitweb.cgi
75 as a template for building a new Catalyst application.
76
77 =head1 SEE ALSO
78
79 L<Gitalist::Controller::Root>
80
81 L<Gitalist::Git::Project>
82
83 L<Catalyst>
84
85 =head1 AUTHORS AND COPYRIGHT
86
87   Catalyst application:
88     (C) 2009 Venda Ltd and Dan Brook <broq@cpan.org>
89     (C) 2009, Tom Doran <bobtfish@bobtfish.net>
90     (C) 2009, Zac Stevens <zts@cryptocracy.com>
91
92   Original gitweb.cgi from which this was derived:
93     (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
94     (C) 2005, Christian Gierke
95
96   Model based on http://github.com/rafl/gitweb
97     (C) 2008, Florian Ragwitz
98
99 =head1 LICENSE
100
101 Licensed under GNU GPL v2
102
103 =cut
104
105 1;