line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PDF::WebKit::Source; |
2
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
67
|
|
3
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
56
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
10
|
use Moo; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
15
|
|
6
|
3
|
|
|
3
|
|
781
|
use namespace::clean; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
12
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has string => ( is => 'rw' ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
around 'BUILDARGS' => sub { |
11
|
|
|
|
|
|
|
my $orig = shift; |
12
|
|
|
|
|
|
|
my $class = shift; |
13
|
|
|
|
|
|
|
if (@_ != 1) { |
14
|
|
|
|
|
|
|
die "Usage: ${class}->new(\$source)\n"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $string = shift; |
18
|
|
|
|
|
|
|
return $class->$orig({ string => $string }); |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub is_url { |
22
|
25
|
|
|
25
|
0
|
167
|
my $self = shift; |
23
|
25
|
|
100
|
|
|
133
|
return (!ref($self->string) && $self->string =~ /^https?:/i); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub is_file { |
27
|
4
|
|
|
4
|
0
|
108
|
my $self = shift; |
28
|
4
|
|
100
|
|
|
19
|
return (!ref($self->string) && !$self->is_url); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub is_html { |
32
|
13
|
|
|
13
|
0
|
123
|
my $self = shift; |
33
|
13
|
|
|
|
|
42
|
return ref($self->string) eq 'SCALAR'; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub content { |
37
|
8
|
|
|
8
|
0
|
92
|
my $self = shift; |
38
|
8
|
100
|
|
|
|
34
|
return ref($self->string) ? ${$self->string} : $self->string; |
|
2
|
|
|
|
|
11
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|