line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::Build::Plugin::Decode::DirListingFtpcopy; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1348
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
44
|
|
5
|
2
|
|
|
2
|
|
31
|
use 5.008004; |
|
2
|
|
|
|
|
8
|
|
6
|
2
|
|
|
2
|
|
470
|
use Alien::Build::Plugin; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
7
|
2
|
|
|
2
|
|
15
|
use File::Basename (); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
636
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Plugin to extract links from a directory listing using ftpcopy |
10
|
|
|
|
|
|
|
our $VERSION = '2.46'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init |
14
|
|
|
|
|
|
|
{ |
15
|
2
|
|
|
2
|
1
|
14
|
my($self, $meta) = @_; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
7
|
$meta->add_requires('share' => 'File::Listing::Ftpcopy' => 0); |
18
|
2
|
|
|
|
|
6
|
$meta->add_requires('share' => 'URI' => 0); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$meta->register_hook( decode => sub { |
21
|
0
|
|
|
0
|
|
0
|
my(undef, $res) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
0
|
die "do not know how to decode @{[ $res->{type} ]}" |
24
|
0
|
0
|
|
|
|
0
|
unless $res->{type} eq 'dir_listing'; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
0
|
my $base = URI->new($res->{base}); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
return { |
29
|
|
|
|
|
|
|
type => 'list', |
30
|
|
|
|
|
|
|
list => [ |
31
|
|
|
|
|
|
|
map { |
32
|
0
|
|
|
|
|
0
|
my($name) = @$_; |
33
|
0
|
|
|
|
|
0
|
my $basename = $name; |
34
|
0
|
|
|
|
|
0
|
$basename =~ s{/$}{}; |
35
|
0
|
|
|
|
|
0
|
my %h = ( |
36
|
|
|
|
|
|
|
filename => File::Basename::basename($basename), |
37
|
|
|
|
|
|
|
url => URI->new_abs($name, $base)->as_string, |
38
|
|
|
|
|
|
|
); |
39
|
0
|
|
|
|
|
0
|
\%h; |
40
|
|
|
|
|
|
|
} File::Listing::Ftpcopy::parse_dir($res->{content}) |
41
|
0
|
|
|
|
|
0
|
], |
42
|
|
|
|
|
|
|
}; |
43
|
2
|
|
|
|
|
16
|
}); |
44
|
|
|
|
|
|
|
|
45
|
2
|
|
|
|
|
5
|
$self; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |