X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FGit%2FUtil.pm;h=9638b8c04fa68065ea00e5868ea4b67f8345d0e0;hb=944f7f7b046e9d7b6c4a2f10677a0ff8bb7b0074;hp=8b17e69a6b66be3c3b96e682f66efb10cd72bbbd;hpb=5156786ba3c8b10e1f7dac9dc652c0e557f9aa12;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Git/Util.pm b/lib/Gitalist/Git/Util.pm index 8b17e69..9638b8c 100644 --- a/lib/Gitalist/Git/Util.pm +++ b/lib/Gitalist/Git/Util.pm @@ -3,16 +3,16 @@ use MooseX::Declare; class Gitalist::Git::Util { use File::Which; use Git::PurePerl; - use IPC::Run qw(run); + use IPC::Run qw(run start); use Symbol qw(geniosym); use MooseX::Types::Common::String qw/NonEmptySimpleStr/; - has project => ( - isa => 'Gitalist::Git::Project', + has repository => ( + isa => 'Gitalist::Git::Repository', handles => { gitdir => 'path' }, is => 'bare', # No accessor weak_ref => 1, # Weak, you have to hold onto me. - predicate => 'has_project', + predicate => 'has_repository', ); has _git => ( isa => NonEmptySimpleStr, is => 'ro', lazy_build => 1 ); sub _build__git { @@ -32,15 +32,15 @@ EOR isa => 'Git::PurePerl', is => 'ro', lazy => 1, default => sub { my $self = shift; - confess("Cannot get gpp without project") - unless $self->has_project; + confess("Cannot get gpp without repository") + unless $self->has_repository; Git::PurePerl->new(gitdir => $self->gitdir); }, ); method run_cmd (@args) { unshift @args, ( '--git-dir' => $self->gitdir ) - if $self->has_project; + if $self->has_repository; # print STDERR 'RUNNING: ', $self->_git, qq[ @args], $/; run [$self->_git, @args], \my($in, $out, $err); @@ -50,9 +50,9 @@ EOR method run_cmd_fh (@args) { my ($in, $out, $err) = (geniosym, geniosym, geniosym); unshift @args, ('--git-dir' => $self->gitdir) - if $self->has_project; + if $self->has_repository; # print STDERR 'RUNNING: ', $self->_git, qq[ @args], $/; - run [$self->_git, @args], + start [$self->_git, @args], 'pipe', $out, '2>pipe', $err @@ -70,3 +70,24 @@ EOR } } # end class + +__END__ + +=head1 NAME + +Gitalist::Git::Util - Class for utilities to run git or deal with Git::PurePerl + +=head1 SEE ALSO + +L. + +=head1 AUTHORS + +See L for authors. + +=head1 LICENSE + +See L for the license. + +=cut +