# 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',
use List::MoreUtils qw/any/;
use File::Which;
+has repo_dir => ( isa => NonEmptySimpleStr, is => 'ro', lazy_build => 1 ); # Fixme - path::class
+has git => ( isa => NonEmptySimpleStr, is => 'ro', lazy_build => 1 );
+
sub BUILD {
my ($self) = @_;
$self->git; # Cause lazy value build.
+ $self->repo_dir;
}
-has git => ( isa => NonEmptySimpleStr, is => 'ro', lazy_build => 1 );
-
sub _build_git {
my $git = File::Which::which('git');
return $git;
}
+sub _build_repo_dir {
+ return Gitalist->config->{repo_dir};
+}
+
sub is_git_repo {
my ($self, $dir) = @_;
return %props;
}
-has repo_dir => ( isa => NonEmptySimpleStr, required => 1, is => 'ro' ); # Fixme - path::class
-
sub list_projects {
my ($self) = @_;