X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit.pm;h=302d713ddbbd9b3b17250c484fe2a51b5c165337;hb=ce5091c087229219cf4dc879fb0d2dcab808b885;hp=f84d445b74b977839fc7db74660c1c1f28d0594b;hpb=19bee8f647bfe6c94c5cb3cf6a60d7a43cbca222;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit.pm b/lib/App/Rgit.pm index f84d445..302d713 100644 --- a/lib/App/Rgit.pm +++ b/lib/App/Rgit.pm @@ -3,9 +3,6 @@ package App::Rgit; use strict; use warnings; -use Cwd qw/abs_path/; -use File::Spec::Functions qw/file_name_is_absolute/; - use Object::Tiny qw/config command/; use App::Rgit::Command; @@ -18,11 +15,11 @@ App::Rgit - Backend that supports the rgit utility. =head1 VERSION -Version 0.01 +Version 0.04 =cut -our $VERSION = '0.01'; +our $VERSION = '0.04'; =head1 DESCRIPTION @@ -40,21 +37,20 @@ Creates a new L object that's bound to execute the command C<$cmd> on sub new { my ($class, %args) = &validate; - my $root = $args{root}; - return unless defined $root and -d $root; - $root = abs_path $root unless file_name_is_absolute $root; - return unless defined $args{git} and -x $args{git}; my $config = App::Rgit::Config->new( - root => $root, + root => $args{root}, git => $args{git}, ); + return unless defined $config; + my $command = App::Rgit::Command->new( + cmd => $args{cmd}, + args => $args{args}, + policy => $args{policy}, + ); + return unless defined $command; $class->SUPER::new( config => $config, - command => App::Rgit::Command->new( - cmd => $args{cmd} || ' ', - args => $args{args}, - repos => $config->repos, - ) + command => $command, ); }