Archive-BagIt-App

 view release on metacpan or  search on metacpan

lib/Archive/BagIt/App/Verify.pm  view on Meta::CPAN

use strict;
use warnings;

our $VERSION = '0.049'; # VERSION

use MooseX::App::Command;

parameter 'bag_path' => (
  is=>'rw',
  isa=>'Str',
  documentation => q[This is the path to run verify on],
  required => 1,
);

option 'return_all_errors' => (
  is => 'rw',
  isa => 'Bool',
  documentation => q[collect all errors rather than dying on first],
);

option 'fast' => (

lib/Archive/BagIt/App/Verify.pm  view on Meta::CPAN

  my $bag_path = $self->bag_path;
  my ($bag);
  if($self->fast) {
    use Archive::BagIt::Fast;
    $bag = Archive::BagIt::Fast->new($bag_path);
  }
  else {
    $bag = Archive::BagIt->new($bag_path);
  }
  eval {
      $bag->verify_bag();
  };
  if ($@) {
      print "FAIL: ".$bag_path." : $! $@\n";
  }
  else {
      print "PASS: ".$bag_path."\n";
  }
}

1



( run in 2.422 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )