use App::Rgit::Command;
use App::Rgit::Config;
-use App::Rgit::Utils qw/validate/;
=head1 NAME
=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,
sub run {
my $self = shift;
+
$self->command->run($self->config);
}