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