extends 'Catalyst';
-use Catalyst qw/-Debug
+use Catalyst qw/
ConfigLoader
Static::Simple
- StackTrace/;
+ StackTrace/;
+
our $VERSION = '0.01';
# Bring in the libified gitweb.cgi.
use gitweb;
-before 'setup' => sub {
- my $app = shift;
- $app->config('Model::Git' => { repo_dir => $app->config('repo_dir') });
-};
-
__PACKAGE__->config(
- name => 'Gitalist',
- default_view => 'Default',
+ name => 'Gitalist',
+ default_view => 'Default',
);
# Start the application
__PACKAGE__->setup();
+around uri_for => sub {
+ my ($orig, $c) = (shift, shift);
+ my $params = Catalyst::Utils::merge_hashes(
+ { p => $c->model('Git')->project },
+ ref($_[-1]) eq 'HASH' ? pop @_ : {}
+ );
+ (my $uri = $c->$orig(@_, $params))
+ =~ tr[&][;];
+ return $uri;
+};
+
=head1 NAME
Gitalist - Catalyst based application