X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit.pm;h=4231436c9329e7ea38dbefda18c1c5252698808f;hb=3ff07b59ff41754a77105973a4f1e9d6d25b2c3a;hp=38e4c38ab289f8c7813a4c0143d03af80c10cf7d;hpb=6106b02a51da37eadcc29155ae4d51c07fff61ce;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit.pm b/lib/App/Rgit.pm index 38e4c38..4231436 100644 --- a/lib/App/Rgit.pm +++ b/lib/App/Rgit.pm @@ -3,11 +3,8 @@ package App::Rgit; use strict; use warnings; -use Object::Tiny qw/config command/; - use App::Rgit::Command; use App::Rgit::Config; -use App::Rgit::Utils qw/validate/; =head1 NAME @@ -15,11 +12,11 @@ App::Rgit - Backend that supports the rgit utility. =head1 VERSION -Version 0.02 +Version 0.07 =cut -our $VERSION = '0.02'; +our $VERSION = '0.07'; =head1 DESCRIPTION @@ -36,21 +33,29 @@ 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}, + 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}, + cmd => $args{cmd}, + args => $args{args}, + policy => $args{policy}, ); return unless defined $command; - $class->SUPER::new( + + bless { config => $config, command => $command, - ); + }, $class; } =head2 C @@ -61,6 +66,7 @@ Actually run the commands. sub run { my $self = shift; + $self->command->run($self->config); } @@ -68,7 +74,13 @@ sub run { =head2 C -Accessors. +Read-only accessors. + +=cut + +BEGIN { + eval "sub $_ { \$_[0]->{$_} }" for qw/config command/; +} =head1 SEE ALSO @@ -77,12 +89,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 @@ -92,7 +105,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2008 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.