line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: /mirror/perl/HTTP-RobotsTag/trunk/lib/HTTP/RobotsTag/Rules.pm 31673 2007-12-09T23:59:12.668743Z daisuke $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTTP::RobotsTag::Rules; |
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
169
|
|
5
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
748
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new |
8
|
|
|
|
|
|
|
{ |
9
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
10
|
1
|
|
|
|
|
3
|
my %args = @_; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
|
|
5
|
my $self = bless { directives => \%args }, $class; |
13
|
1
|
|
|
|
|
14
|
return $self; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub can_index |
17
|
|
|
|
|
|
|
{ |
18
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
19
|
1
|
|
|
|
|
6
|
my $dir = $self->{directives}; |
20
|
1
|
|
33
|
|
|
11
|
return ! $dir->{noindex} && ! $dir->{none}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub can_follow |
24
|
|
|
|
|
|
|
{ |
25
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
26
|
0
|
|
|
|
|
0
|
my $dir = $self->{directives}; |
27
|
0
|
|
0
|
|
|
0
|
return ! $dir->{nofollow} && ! $dir->{none}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub can_archive |
31
|
|
|
|
|
|
|
{ |
32
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
33
|
0
|
|
|
|
|
0
|
my $dir = $self->{directives}; |
34
|
0
|
|
0
|
|
|
0
|
return ! $dir->{noarchive} && ! $dir->{none}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub can_snippet |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
40
|
0
|
|
|
|
|
0
|
my $dir = $self->{directives}; |
41
|
0
|
|
0
|
|
|
0
|
return ! $dir->{nosnippet} && ! $dir->{none}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub is_available |
45
|
|
|
|
|
|
|
{ |
46
|
2
|
|
|
2
|
1
|
881
|
my $self = shift; |
47
|
2
|
|
|
|
|
4
|
my $dt = shift; |
48
|
|
|
|
|
|
|
|
49
|
2
|
|
|
|
|
4
|
my $limit = $self->{directives}->{unavailable_after}; |
50
|
2
|
50
|
|
|
|
25
|
if ($limit) { |
51
|
2
|
|
|
|
|
83
|
return $dt->compare($limit) <= 0; |
52
|
|
|
|
|
|
|
} |
53
|
0
|
|
|
|
|
|
return 1; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |