File Coverage

blib/lib/SVN/Class/Dir.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 6 0.0
condition 0 4 0.0
subroutine 4 6 66.6
pod 2 2 100.0
total 18 39 46.1


line stmt bran cond sub pod time code
1             package SVN::Class::Dir;
2 2     2   12 use strict;
  2         3  
  2         72  
3 2     2   10 use warnings;
  2         4  
  2         186  
4 2     2   11 use base qw( Path::Class::Dir SVN::Class );
  2         13  
  2         280  
5 2     2   19 use SVN::Class::File;
  2         5  
  2         669  
6              
7             our $VERSION = '0.17';
8              
9             # override some Path::Class stuff to return SVN::Class objects instead
10             sub file {
11 0 0   0 1   local $Path::Class::Foreign = $_[0]->{file_spec_class}
12             if $_[0]->{file_spec_class};
13 0           return SVN::Class::File->new(@_);
14             }
15              
16             sub new {
17 0     0 1   my $self = Path::Class::Entity::new(shift);
18 0           my $s = $self->_spec;
19              
20 0 0         my $first = (
    0          
21             @_ == 0 ? $s->curdir
22             : $_[0] eq '' ? ( shift, $s->rootdir )
23             : shift()
24             );
25              
26 0   0       ( $self->{volume}, my $dirs )
27             = $s->splitpath( $s->canonpath($first) || '', 1 );
28 0           $self->{dirs} = [ $s->splitdir( $s->catdir( $dirs, @_ ) ) ];
29 0   0       $self->{svn} ||= 'svn';
30 0           return $self;
31             }
32              
33             1;
34              
35             __END__