line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################################### |
2
|
|
|
|
|
|
|
package CrawlerCommons::RobotToken; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# MODULE IMPORTS |
5
|
|
|
|
|
|
|
######################################## |
6
|
|
|
|
|
|
|
# Pragmas |
7
|
|
|
|
|
|
|
#------------------# |
8
|
2
|
|
|
2
|
|
29
|
use 5.10.1; |
|
2
|
|
|
|
|
8
|
|
9
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
43
|
|
10
|
2
|
|
|
2
|
|
9
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
11
|
2
|
|
|
2
|
|
35
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# CPAN/Core |
14
|
|
|
|
|
|
|
#------------------# |
15
|
2
|
|
|
2
|
|
10
|
use Const::Fast; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
16
|
2
|
|
|
2
|
|
142
|
use Try::Tiny; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
82
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Moose Setup |
19
|
|
|
|
|
|
|
#------------------# |
20
|
2
|
|
|
2
|
|
11
|
use Moose; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
14
|
|
21
|
2
|
|
|
2
|
|
12108
|
use namespace::autoclean; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
20
|
|
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.01'; |
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__ |