blib/lib/File/Spec/Epoc.pm

filter: Statementstmt 100% 17 / 17 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 2 / 2 totaltotal 96.4% 27 / 28 CC 4 SCAR 11.0
CC
4
Cov
96%
canonpath
4.0
BEGIN
1.0
case_tolerant
1.0
CRAP 3.0
« blib/lib/File/Spec/AmigaOS.pm ↑ Summary blib/lib/File/Spec.pm »
1 package File::Spec::Epoc;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 our $VERSION = '3.75';
6 2 $VERSION =~ tr/_//d;
7  
8 2 require File::Spec::Unix;
9 2 our @ISA = qw(File::Spec::Unix);
10  
11 =head1 NAME
12  
13 File::Spec::Epoc - methods for Epoc file specs
14  
15 =head1 SYNOPSIS
16  
17 require File::Spec::Epoc; # Done internally by File::Spec if needed
18  
19 =head1 DESCRIPTION
20  
21 See File::Spec::Unix for a documentation of the methods provided
22 there. This package overrides the implementation of these methods, not
23 the semantics.
24  
25 This package is still a work in progress. ;-)
26  
27 =cut
28  
29 1 ▶sub case_tolerant {
Subroutine case_tolerant: called CC=1 SCAR=0.0
Pod documented
30 1 return 1;
31 }
32  
33 =pod
34  
35 =over 4
36  
37 =item canonpath()
38  
39 No physical check on the filesystem, but a logical cleanup of a
40 path. On UNIX eliminated successive slashes and successive "/.".
41  
42 =back
43  
44 =cut
45  
46 72 ▶sub canonpath {
Subroutine canonpath: called CC=4 SCAR=13.9
Pod documented
47 72 my ($self,$path) = @_;
48 72 ▶ return unless defined $path;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $path 2 70 72
49  
50 70 $path =~ s|/+|/|g; # xx////xx -> xx/xx
51 70 $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx
52 70 ▶ $path =~ s|^(\./)+||s unless $path eq "./"; # ./xx -> xx
Branch: 1 branch
BranchTrueFalseTotal
unless $path eq "./" 70 0 70
53 70 $path =~ s|^/(\.\./)+|/|s; # /../../xx -> xx
54 70 ▶ $path =~ s|/\Z(?!\n)|| unless $path eq "/"; # xx/ -> xx
Branch: 1 branch
BranchTrueFalseTotal
unless $path eq "/" 69 1 70
55 70 return $path;
56 }
57  
58 =pod
59  
60 =head1 AUTHOR
61  
62 o.flebbe@gmx.de
63  
64 =head1 COPYRIGHT
65  
66 Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.
67  
68 This program is free software; you can redistribute it and/or modify
69 it under the same terms as Perl itself.
70  
71 =head1 SEE ALSO
72  
73 See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
74 implementation of these methods, not the semantics.
75  
76 =cut
77  
78 2 1;
« blib/lib/File/Spec/AmigaOS.pm ↑ Summary blib/lib/File/Spec.pm »