]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - lib/App/Rgit.pm
Get rid of validate()
[perl/modules/rgit.git] / lib / App / Rgit.pm
index 1c8873d714b3a8a360a6091c38f123b658467a39..ea9df10da2367299fe37c7ad995f43e9db3b69b1 100644 (file)
@@ -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<App::Rgit> 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);
 }