From: bobtfish Date: Mon, 2 Nov 2009 20:48:06 +0000 (+0000) Subject: Get everything actually working with this in place in my public_html directory X-Git-Tag: 0.000000_01~100^2~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45420449dec013b011625475b4bd1cab1269f200;hp=7268d0ae3de80038b738f3e7dfa873be9d7dc96c;p=catagits%2FGitalist.git Get everything actually working with this in place in my public_html directory --- diff --git a/Makefile.PL b/Makefile.PL index 3cae090..0484ec1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -29,7 +29,7 @@ requires 'DateTime'; requires 'Git::PurePerl'; requires 'List::MoreUtils'; requires 'MooseX::Declare'; -requires 'Path::Class'; +requires 'Path::Class' => '0.17'; requires 'Sub::Exporter'; requires 'Syntax::Highlight::Engine::Kate'; requires 'Moose::Autobox'; diff --git a/gitalist.conf b/gitalist.conf index 54ee7d0..386071e 100644 --- a/gitalist.conf +++ b/gitalist.conf @@ -2,8 +2,8 @@ name Gitalist #git /path/to/git - # projectroot /home/dbrook/dev - # repo_dir /home/dbrook/dev + projectroot __path_to(../)__ + repo_dir __path_to(../)__ sitename "Gitalist presently" diff --git a/lib/Gitalist/Model/Git.pm b/lib/Gitalist/Model/Git.pm index fb16221..7c56625 100644 --- a/lib/Gitalist/Model/Git.pm +++ b/lib/Gitalist/Model/Git.pm @@ -23,7 +23,7 @@ Gitalist::Model::Git - the model for git interactions =cut use Git::PurePerl; - +use Path::Class qw/dir/; sub build_per_context_instance { my ( $self, $c ) = @_; @@ -34,8 +34,9 @@ sub build_per_context_instance { ); # This is fugly as fuck. Move Git::PurePerl construction into attribute builders.. - (my $pd = $self->project_dir( $self->project )) =~ s{/\.git$}(); - $model->gpp( Git::PurePerl->new(directory => $pd) ); + my ($pd, $gd) = $model->project_dir( $model->project )->resolve =~ m{((.+?)(:?/\/\.git)?$)}; + $gd .= '/.git' if ($gd !~ /\.git$/ and -d "$gd/.git"); + $model->gpp( Git::PurePerl->new(gitdir => $gd, directory => $pd) ); return $model; }