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