X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit.pm;h=ef56f6c0d8f62f8a054a250d37d9807713b1d791;hb=HEAD;hp=a91f37ea8ae29af4af362e1ecd662ff900fc3dd0;hpb=76ba389e3711e8f254aea83f9b3b7b221c0517a8;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit.pm b/lib/App/Rgit.pm index a91f37e..ef56f6c 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 @@ -13,11 +12,11 @@ App::Rgit - Backend that supports the rgit utility. =head1 VERSION -Version 0.06 +Version 0.08 =cut -our $VERSION = '0.06'; +our $VERSION = '0.08'; =head1 DESCRIPTION @@ -27,26 +26,39 @@ This is an internal class to L. =head1 METHODS -=head2 C<< new root => $root, git => $git, cmd => $cmd, args => \@args >> +=head2 C + + my $ar = App::Rgit->new( + root => $root, + git => $git, + cmd => $cmd, + args => \@args, + ); Creates a new L object that's bound to execute the command C<$cmd> on all the C repositories inside C<$root> with C<@args> as arguments and C<$git> as C executable. =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 +73,7 @@ Actually run the commands. sub run { my $self = shift; + $self->command->run($self->config); } @@ -73,7 +86,7 @@ Read-only accessors. =cut BEGIN { - eval "sub $_ { \$_[0]->{$_} }" for qw/config command/; + eval "sub $_ { \$_[0]->{$_} }" for qw; } =head1 SEE ALSO @@ -83,12 +96,13 @@ L. =head1 AUTHOR Vincent Pit, C<< >>, L. - + 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 @@ -98,7 +112,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2008-2009 Vincent Pit, all rights reserved. +Copyright 2008,2009,2010 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.