Started the switch from hand-written URLs to uri_for.
[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
14use Class::C3::Adopt::NEXT -no_warn;
15
89de6a33 16our $VERSION = '0.01';
17
4666d5c7 18# Bring in the libified gitweb.cgi.
19use gitweb;
20
d3feefcf 21__PACKAGE__->config(
61b56ed6 22 name => 'Gitalist',
23 default_view => 'Default',
d3feefcf 24);
89de6a33 25
26# Start the application
27__PACKAGE__->setup();
28
61b56ed6 29sub uri_for {
30 my $p = ref $_[-1] eq 'HASH'
31 ? $_[-1]
32 : push(@_, {}) && $_[-1];
33 $p->{p} = $_[0]->model('Git')->project;
34
35 (my $uri = $_[0]->NEXT::uri_for(@_[1 .. $#_]))
36 # Ampersand! What is this, the 90s?
37 =~ s/&/;/g;
38 return $uri;
39}
40
89de6a33 41=head1 NAME
42
43Gitalist - Catalyst based application
44
45=head1 SYNOPSIS
46
47 script/gitalist_server.pl
48
49=head1 DESCRIPTION
50
51[enter your description here]
52
53=head1 SEE ALSO
54
55L<Gitalist::Controller::Root>, L<Catalyst>
56
42fe5d11 57=head1 AUTHORS AND COPYRIGHT
89de6a33 58
42fe5d11 59 Catalyst application:
60 (C) 2009 Venda Ltd and Dan Brook <dbrook@venda.com>
61
62 Original gitweb.cgi from which this was derived:
63 (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
64 (C) 2005, Christian Gierke
89de6a33 65
66=head1 LICENSE
67
42fe5d11 68FIXME - Is this going to be GPLv2 as per gitweb? If so this is broken..
69
89de6a33 70This library is free software. You can redistribute it and/or modify
71it under the same terms as Perl itself.
72
73=cut
74
751;