X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit.pm;h=ea9df10da2367299fe37c7ad995f43e9db3b69b1;hb=1c5bf56c6f80e4cd818c341b34ba3410f34ed514;hp=a91f37ea8ae29af4af362e1ecd662ff900fc3dd0;hpb=76ba389e3711e8f254aea83f9b3b7b221c0517a8;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit.pm b/lib/App/Rgit.pm index a91f37e..ea9df10 100644 --- a/lib/App/Rgit.pm +++ b/lib/App/Rgit.pm @@ -5,7 +5,6 @@ use warnings; use App::Rgit::Command; use App::Rgit::Config; -use App::Rgit::Utils qw/validate/; =head1 NAME @@ -34,19 +33,25 @@ Creates a new L object that's bound to execute the command C<$cmd> on =cut sub new { - my ($class, %args) = &validate; + my $class = shift; + $class = ref $class || $class; + + my %args = @_; + my $config = App::Rgit::Config->new( root => $args{root}, git => $args{git}, debug => $args{debug}, ); return unless defined $config; + my $command = App::Rgit::Command->new( cmd => $args{cmd}, args => $args{args}, policy => $args{policy}, ); return unless defined $command; + bless { config => $config, command => $command, @@ -61,6 +66,7 @@ Actually run the commands. sub run { my $self = shift; + $self->command->run($self->config); } @@ -83,7 +89,7 @@ L. =head1 AUTHOR Vincent Pit, C<< >>, L. - + You can contact me by mail or on C (vincent). =head1 BUGS