line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Help Directive for Validation Class Field Definitions |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Validation::Class::Directive::Help; |
4
|
|
|
|
|
|
|
|
5
|
108
|
|
|
108
|
|
68365
|
use strict; |
|
108
|
|
|
|
|
226
|
|
|
108
|
|
|
|
|
2794
|
|
6
|
108
|
|
|
108
|
|
539
|
use warnings; |
|
108
|
|
|
|
|
200
|
|
|
108
|
|
|
|
|
2831
|
|
7
|
|
|
|
|
|
|
|
8
|
108
|
|
|
108
|
|
528
|
use base 'Validation::Class::Directive'; |
|
108
|
|
|
|
|
196
|
|
|
108
|
|
|
|
|
7711
|
|
9
|
|
|
|
|
|
|
|
10
|
108
|
|
|
108
|
|
584
|
use Validation::Class::Util; |
|
108
|
|
|
|
|
220
|
|
|
108
|
|
|
|
|
767
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900057'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1002
|
|
|
1002
|
0
|
1715
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# static help-text may contain multiline strings for the sake of |
24
|
|
|
|
|
|
|
# aesthetics, flatten them here |
25
|
|
|
|
|
|
|
|
26
|
1002
|
50
|
|
|
|
2821
|
if (defined $field->{help}) { |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
0
|
$field->{help} =~ s/^[\n\s\t\r]+//g; |
29
|
0
|
|
|
|
|
0
|
$field->{help} =~ s/[\n\s\t\r]+$//g; |
30
|
0
|
|
|
|
|
0
|
$field->{help} =~ s/[\n\s\t\r]+/ /g; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
1002
|
|
|
|
|
2835
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |