line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::dirname; |
2
|
2
|
|
|
2
|
|
912
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
106846
|
|
|
2
|
|
|
|
|
10
|
|
3
|
2
|
|
|
2
|
|
370
|
use Moo; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
4
|
2
|
|
|
2
|
|
432
|
use File::Basename qw(); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
28
|
|
5
|
2
|
|
|
2
|
|
438
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
628
|
|
|
2
|
|
|
|
|
14
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub emit_value { |
12
|
1
|
|
|
1
|
0
|
6352
|
my ($self, $var) = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
6
|
"${var} = File::Basename::dirname(${var}) if is_string( ${var} );"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Catmandu::Fix::dirname - get file directory |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
add_field('path','/home/njfranck') |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#'path' is now '/home' |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
dirname('path') |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 AUTHOR |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Nicolas Franck, C<< <nicolas.franck at ugent.be> >> |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SEE ALSO |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
L<Catmandu::Fix> |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |