line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cikl::Smrt::Fetchers::File; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1202
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
51
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
5
|
1
|
|
|
1
|
|
1028
|
use URI::file; |
|
1
|
|
|
|
|
7969
|
|
|
1
|
|
|
|
|
42
|
|
6
|
1
|
|
|
1
|
|
12
|
use Mouse; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
7
|
1
|
|
|
1
|
|
401
|
use IO::File; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
238
|
|
8
|
1
|
|
|
1
|
|
7
|
use Cikl::Smrt::Fetcher; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
9
|
|
|
|
|
|
|
extends 'Cikl::Smrt::Fetcher'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
5
|
use namespace::autoclean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
248
|
use constant SCHEMES => ( |
14
|
|
|
|
|
|
|
'file', |
15
|
|
|
|
|
|
|
'__undef__'# this tells us that it's a relative path. |
16
|
1
|
|
|
1
|
|
76
|
); |
|
1
|
|
|
|
|
2
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub schemes { |
19
|
4
|
|
|
4
|
0
|
185
|
return SCHEMES; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub fetch { |
23
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
my $feedurl = $self->feedurl(); |
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
if (!defined($feedurl->scheme())) { |
27
|
|
|
|
|
|
|
# it's going to be a relative URL. |
28
|
0
|
|
|
|
|
|
$feedurl = URI::file->new_abs($feedurl->as_string()); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
unless ($feedurl->scheme() eq 'file') { |
32
|
0
|
|
|
|
|
|
die("Unsupported URI scheme: " . $feedurl->scheme); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
0
|
|
|
|
my $fh = IO::File->new("< " . $feedurl->path) || die($!.': '.$feedurl->path); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return $fh; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |