App-Cmd

 view release on metacpan or  search on metacpan

lib/App/Cmd/Command.pm  view on Meta::CPAN


#pod =method new
#pod
#pod This returns a new instance of the command plugin.  Probably only C<prepare>
#pod should use this.
#pod
#pod =cut

sub new {
  my ($class, $arg) = @_;
  bless $arg => $class;
}

#pod =method execute
#pod
#pod   $command_plugin->execute(\%opt, \@args);
#pod
#pod This method does whatever it is the command should do!  It is passed a hash
#pod reference of the parsed command-line options and an array reference of left
#pod over arguments.
#pod

lib/App/Cmd/Tester.pm  view on Meta::CPAN

    error  => $error,
    run_rv => $run_rv,
  };
}

{
  package App::Cmd::Tester::Result 0.336;

  sub new {
    my ($class, $arg) = @_;
    bless $arg => $class;
  }

  for my $attr (qw(app stdout stderr output error run_rv exit_code)) {
    Sub::Install::install_sub({
      code => sub { $_[0]->{$attr} },
      as   => $attr,
    });
  }
}

{
  package App::Cmd::Tester::Exited 0.336;

  sub throw {
    my ($class, $code) = @_;
    $code = 0 unless defined $code;
    my $self = (bless \$code => $class);
    die $self;
  }
}

1;

__END__

=pod

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.010 second using v1.00-cache-2.02-grep-82fe00e-cpan-503542c4f10 )