line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################################### |
2
|
|
|
|
|
|
|
package CrawlerCommons::RobotToken; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# MODULE IMPORTS |
5
|
|
|
|
|
|
|
######################################## |
6
|
|
|
|
|
|
|
# Pragmas |
7
|
|
|
|
|
|
|
#------------------# |
8
|
2
|
|
|
2
|
|
33
|
use 5.10.1; |
|
2
|
|
|
|
|
9
|
|
9
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
55
|
|
10
|
2
|
|
|
2
|
|
13
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
16
|
|
11
|
2
|
|
|
2
|
|
57
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
72
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# CPAN/Core |
14
|
|
|
|
|
|
|
#------------------# |
15
|
2
|
|
|
2
|
|
13
|
use Const::Fast; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
20
|
|
16
|
2
|
|
|
2
|
|
167
|
use Try::Tiny; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
103
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Moose Setup |
19
|
|
|
|
|
|
|
#------------------# |
20
|
2
|
|
|
2
|
|
15
|
use Moose; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
14
|
|
21
|
2
|
|
|
2
|
|
21489
|
use namespace::autoclean; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
29
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Moose Pragmas |
24
|
|
|
|
|
|
|
#------------------# |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Custom Modules |
27
|
|
|
|
|
|
|
#------------------# |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# VARIABLES/CONSTANTS |
32
|
|
|
|
|
|
|
######################################## |
33
|
|
|
|
|
|
|
# Debug Constants |
34
|
|
|
|
|
|
|
#------------------# |
35
|
|
|
|
|
|
|
const my $DEBUG => $ENV{DEBUG} // 0; |
36
|
|
|
|
|
|
|
const my $TEST => $ENV{TEST} // 1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Constants |
39
|
|
|
|
|
|
|
#------------------# |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Variables |
42
|
|
|
|
|
|
|
#------------------# |
43
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ATTRIBUTES |
47
|
|
|
|
|
|
|
######################################## |
48
|
|
|
|
|
|
|
# Class |
49
|
|
|
|
|
|
|
#------------------# |
50
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
51
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# Instance |
54
|
|
|
|
|
|
|
#------------------# |
55
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
56
|
|
|
|
|
|
|
has 'data' => ( |
57
|
|
|
|
|
|
|
is => 'ro', |
58
|
|
|
|
|
|
|
isa => 'Str', |
59
|
|
|
|
|
|
|
required => 1, |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
62
|
|
|
|
|
|
|
has 'directive' => ( |
63
|
|
|
|
|
|
|
is => 'ro', |
64
|
|
|
|
|
|
|
isa => 'CrawlerCommons::RobotDirective', |
65
|
|
|
|
|
|
|
required => 1, |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# METHODS |
70
|
|
|
|
|
|
|
######################################## |
71
|
|
|
|
|
|
|
# Constructor |
72
|
|
|
|
|
|
|
#------------------# |
73
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
74
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Class Methods |
77
|
|
|
|
|
|
|
#------------------# |
78
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
79
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# Instance Methods |
82
|
|
|
|
|
|
|
#------------------# |
83
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
84
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# Private Methods |
87
|
|
|
|
|
|
|
#------------------# |
88
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
89
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------# |
90
|
|
|
|
|
|
|
############################################################################### |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
############################################################################### |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
1; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
__END__ |