Mangle default title
[catagits/Gitalist.git] / lib / Gitalist.pm
CommitLineData
89de6a33 1package Gitalist;
42fe5d11 2use Moose;
775e96e0 3BEGIN { require 5.008006; }
89de6a33 4use Catalyst::Runtime 5.80;
775e96e0 5use namespace::autoclean;
89de6a33 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
28193751 16our $VERSION = '0.000001';
775e96e0 17$VERSION = eval $VERSION;
89de6a33 18
d3feefcf 19__PACKAGE__->config(
61b56ed6 20 name => 'Gitalist',
21 default_view => 'Default',
1aad4e81 22 default_model => 'GitRepos',
d3feefcf 23);
89de6a33 24
89de6a33 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
775e96e0 411;
42
43__END__
44
89de6a33 45=head1 NAME
46
775e96e0 47Gitalist - A modern git web viewer
89de6a33 48
49=head1 SYNOPSIS
50
51 script/gitalist_server.pl
52
b6d010e1 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
775e96e0 64need the author modules.
b6d010e1 65
89de6a33 66=head1 DESCRIPTION
67
b6d010e1 68Gitalist is a web frontend for git repositories based on gitweb.cgi
775e96e0 69and backed by Catalyst.
b6d010e1 70
71=head2 History
72
73This project started off as an attempt to port gitweb.cgi to a
74Catalyst app in a piecemeal fashion. As it turns out, thanks largely
75to Florian Ragwitz's earlier effort, it was easier to use gitweb.cgi
76as a template for building a new Catalyst application.
89de6a33 77
78=head1 SEE ALSO
79
b6d010e1 80L<Gitalist::Controller::Root>
81
82L<Gitalist::Git::Project>
83
84L<Catalyst>
89de6a33 85
42fe5d11 86=head1 AUTHORS AND COPYRIGHT
89de6a33 87
42fe5d11 88 Catalyst application:
b6d010e1 89 (C) 2009 Venda Ltd and Dan Brook <broq@cpan.org>
90 (C) 2009, Tom Doran <bobtfish@bobtfish.net>
91 (C) 2009, Zac Stevens <zts@cryptocracy.com>
42fe5d11 92
93 Original gitweb.cgi from which this was derived:
94 (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
95 (C) 2005, Christian Gierke
89de6a33 96
b6d010e1 97 Model based on http://github.com/rafl/gitweb
98 (C) 2008, Florian Ragwitz
89de6a33 99
b6d010e1 100=head1 LICENSE
42fe5d11 101
b6d010e1 102Licensed under GNU GPL v2
89de6a33 103
104=cut