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