X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit%2FRepository.pm;h=8356f246cf2f9f0ab1834965bfa15a9fb4e24518;hb=80656eec9bd2400f8db71d0d10d7d0be54139667;hp=df44edc754306d22f89605391dd73ec3fc614366;hpb=517c579bda9717613f7faa9ffe41ef1648199e9b;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit/Repository.pm b/lib/App/Rgit/Repository.pm index df44edc..8356f24 100644 --- a/lib/App/Rgit/Repository.pm +++ b/lib/App/Rgit/Repository.pm @@ -3,10 +3,12 @@ package App::Rgit::Repository; use strict; use warnings; -use Cwd (); # cwd, abs_path +use Cwd (); # cwd use File::Spec (); # canonpath, catdir, splitdir, abs2rel use POSIX (); # WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG SIGINT SIGQUIT +use App::Rgit::Utils (); # abs_path + my ($WIFEXITED, $WEXITSTATUS, $WIFSIGNALED, $WTERMSIG); BEGIN { @@ -26,11 +28,11 @@ App::Rgit::Repository - Class representing a Git repository. =head1 VERSION -Version 0.06 +Version 0.08 =cut -our $VERSION = '0.06'; +our $VERSION = '0.08'; =head1 DESCRIPTION @@ -40,7 +42,12 @@ This is an internal class to L. =head1 METHODS -=head2 C<< new dir => $dir [, fake => 1 ] >> +=head2 C + + my $arr = App::Rgit::Repository->new( + dir => $dir, + fake => $bool, + ); Creates a new repository starting from C<$dir>. If the C option is passed, C<$dir> isn't checked to be a valid C repository. @@ -55,7 +62,7 @@ sub new { my $dir = $args{dir}; if (defined $dir) { - $dir = Cwd::abs_path($dir); + $dir = App::Rgit::Utils::abs_path($dir); } else { $dir = Cwd::cwd; } @@ -114,7 +121,9 @@ sub chdir { return 1; } -=head2 C +=head2 C + + my $code = $arr->run($conf, @args); Runs C on the repository for the L configuration C<$conf>. When the repository isn't fake, the format substitutions applies to C<@args> elements. @@ -179,7 +188,7 @@ sub run { if ($WIFSIGNALED->($?)) { $sig = $WTERMSIG->($?); $conf->warn("git died with signal $sig\n"); - if ($sig == POSIX::SIGINT || $sig == POSIX::SIGQUIT) { + if ($sig == POSIX::SIGINT() || $sig == POSIX::SIGQUIT()) { $conf->err("Aborting\n"); exit $sig; } @@ -205,7 +214,7 @@ Read-only accessors. =cut BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/fake repo bare name work/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } =head1 SEE ALSO @@ -220,7 +229,8 @@ You can contact me by mail or on C (vincent). =head1 BUGS -Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. +Please report any bugs or feature requests to C, or through the web interface at L. +I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT