File Coverage

blib/lib/JavaScript/Librarian/Library.pm
Criterion Covered Total %
statement 10 17 58.8
branch 0 4 0.0
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 15 27 55.5


line stmt bran cond sub pod time code
1             package JavaScript::Librarian::Library;
2              
3 1     1   4 use strict;
  1         2  
  1         29  
4 1     1   4 use base 'Algorithm::Dependency::Source';
  1         1  
  1         59  
5              
6 1     1   4 use vars qw{$VERSION};
  1         1  
  1         43  
7             BEGIN {
8 1     1   117 $VERSION = '1.00';
9             }
10              
11              
12              
13              
14              
15             #####################################################################
16             # Algorithm::Dependency::Source Methods
17              
18             # Overload ->load to add checking to make sure that all the ::Book
19             # object have a valid ->path.
20             sub load {
21 0     0 1   my $self = shift;
22 0           my $class = ref $self;
23              
24             # Call the normal method
25 0 0         $self->SUPER::load or return undef;
26              
27             # Check that all the items are Book objects
28 0           foreach my $Book ( $self->items ) {
29 0 0         next if UNIVERSAL::isa($Book, 'JavaScript::Librarian::Book');
30 0           die "$class\::_load_item_list returned something that was not a JavaScript::Library::Book";
31             }
32              
33 0           1;
34             }
35              
36             1;