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