X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FApp%2FRgit%2FCommand.pm;h=7fbba531a4a4e17cdda8bcf08efc806601ed44ef;hb=df425e04a0fe374b7e1906e417f8238af257742f;hp=348b8c40aab70ef4c659ba8167ca287222b95807;hpb=1c5bf56c6f80e4cd818c341b34ba3410f34ed514;p=perl%2Fmodules%2Frgit.git diff --git a/lib/App/Rgit/Command.pm b/lib/App/Rgit/Command.pm index 348b8c4..7fbba53 100644 --- a/lib/App/Rgit/Command.pm +++ b/lib/App/Rgit/Command.pm @@ -3,7 +3,7 @@ package App::Rgit::Command; use strict; use warnings; -use Carp qw/croak/; +use Carp (); use App::Rgit::Utils qw/:codes/; @@ -50,11 +50,12 @@ sub new { if ($class eq __PACKAGE__) { $class = $action; } else { - croak "Command $cmd should be executed as a $action" - unless $class->isa($action); + Carp::confess("Command $cmd should be executed as a $action") + unless $class->isa($action); } - eval "require $action; 1" or croak "Couldn't load $action: $@"; + eval "require $action; 1" or Carp::confess("Couldn't load $action: $@"); + bless { cmd => $cmd, args => $args{args} || [ ], @@ -93,7 +94,7 @@ Returns what policy C method returned, which should be one of the policy sub report { my ($self) = @_; - my $code = $self->policy->report(@_); + my $code = $self->policy->handle(@_); return defined $code ? $code : NEXT; } @@ -130,7 +131,8 @@ 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 @@ -140,7 +142,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.