X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist.pm;h=5213ef7aba65b916bc033ffc0c5c91cd6d08dd93;hb=deb6344b79370d2dda7dc41ce1aa11ac03c6c3e2;hp=7538376c87e5cfe09c577bd814a6830f3b9b6ead;hpb=4666d5c7808a05b70242119f24c72a479fd732f7;p=catagits%2FGitalist.git diff --git a/lib/Gitalist.pm b/lib/Gitalist.pm index 7538376..5213ef7 100644 --- a/lib/Gitalist.pm +++ b/lib/Gitalist.pm @@ -1,44 +1,43 @@ package Gitalist; - -use strict; -use warnings; +use Moose; +use namespace::autoclean; use Catalyst::Runtime 5.80; -# Set flags and add plugins for the application -# -# -Debug: activates the debug mode for very useful log messages -# ConfigLoader: will load the configuration from a Config::General file in the -# application's home directory -# Static::Simple: will serve static files from the application's root -# directory +extends 'Catalyst'; -use parent qw/Catalyst/; use Catalyst qw/-Debug ConfigLoader - Static::Simple/; + Static::Simple + StackTrace/; + +use Class::C3::Adopt::NEXT -no_warn; + our $VERSION = '0.01'; # Bring in the libified gitweb.cgi. use gitweb; -# Configure the application. -# -# Note that settings in gitalist.conf (or other external -# configuration file that you set up manually) take precedence -# over this when using ConfigLoader. Thus configuration -# details given here can function as a default configuration, -# with an external configuration file acting as an override for -# local deployment. - __PACKAGE__->config( - name => 'Gitalist', - default_view => 'Default', + name => 'Gitalist', + default_view => 'Default', ); # Start the application __PACKAGE__->setup(); +sub uri_for { + my $p = ref $_[-1] eq 'HASH' + ? $_[-1] + : push(@_, {}) && $_[-1]; + $p->{p} = $_[0]->model('Git')->project; + + (my $uri = $_[0]->NEXT::uri_for(@_[1 .. $#_])) + # Ampersand! What is this, the 90s? + =~ s/&/;/g; + return $uri; +} + =head1 NAME Gitalist - Catalyst based application @@ -55,12 +54,19 @@ Gitalist - Catalyst based application L, L -=head1 AUTHOR +=head1 AUTHORS AND COPYRIGHT -Dan Brook,,, + Catalyst application: + (C) 2009 Venda Ltd and Dan Brook + + Original gitweb.cgi from which this was derived: + (C) 2005-2006, Kay Sievers + (C) 2005, Christian Gierke =head1 LICENSE +FIXME - Is this going to be GPLv2 as per gitweb? If so this is broken.. + This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.