line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: /mirror/perl/GunghoX-FollowLinks/trunk/lib/GunghoX/FollowLinks/Rule.pm 8918 2007-11-12T03:02:15.291385Z daisuke $ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2007 Daisuke Maki <daisuke@endeworks.jp> |
4
|
|
|
|
|
|
|
# All rights reserved. |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package GunghoX::FollowLinks::Rule; |
7
|
5
|
|
|
5
|
|
366557
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
157
|
|
8
|
5
|
|
|
5
|
|
23
|
use warnings; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
166
|
|
9
|
5
|
|
|
5
|
|
22
|
use base qw(Gungho::Base); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
1370
|
|
10
|
|
|
|
|
|
|
|
11
|
5
|
|
|
|
|
47
|
use Sub::Exporter -setup => { |
12
|
|
|
|
|
|
|
exports => [ qw(FOLLOW_ALLOW FOLLOW_DENY FOLLOW_DEFER) ] |
13
|
5
|
|
|
5
|
|
17944
|
}; |
|
5
|
|
|
|
|
43986
|
|
14
|
5
|
|
|
5
|
|
1487
|
use constant FOLLOW_ALLOW => "FOLLOW_ALLOW"; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
433
|
|
15
|
5
|
|
|
5
|
|
24
|
use constant FOLLOW_DENY => "FOLLOW_DENY"; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
268
|
|
16
|
5
|
|
|
5
|
|
27
|
use constant FOLLOW_DEFER => "FOLLOW_DEFER"; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
322
|
|
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
0
|
1
|
|
sub apply { die "You must override apply()" } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
__END__ |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
GunghoX::FollowLinks::Rule - Rule To Decide If A Link Should Be Followed |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use GunghoX::FollowLinks::Rule q(FOLLOW_ALLOW FOLLOW_DENY FOLLOW_DEFER); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
package MyRule; |
33
|
|
|
|
|
|
|
use base qw(GunghoX::FollowLinks::Rule); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub apply { |
36
|
|
|
|
|
|
|
# custom logic |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 CONSTANTS |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 FOLLOW_ALLOW |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 FOLLOW_DENY |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 FOLLOW_DEFER |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 METHODS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 apply |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Subclasses must override this method. The exact arguments change depending |
52
|
|
|
|
|
|
|
on the GunghoX::FollowLinks::Parser object being used, but the first two |
53
|
|
|
|
|
|
|
elements are always the global Gungho context and the Gungho::Response |
54
|
|
|
|
|
|
|
object. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |