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
|
109
|
|
|
109
|
|
42260
|
use strict; |
|
109
|
|
|
|
|
260
|
|
|
109
|
|
|
|
|
2620
|
|
6
|
109
|
|
|
109
|
|
492
|
use warnings; |
|
109
|
|
|
|
|
212
|
|
|
109
|
|
|
|
|
2311
|
|
7
|
|
|
|
|
|
|
|
8
|
109
|
|
|
109
|
|
470
|
use base 'Validation::Class::Directive'; |
|
109
|
|
|
|
|
196
|
|
|
109
|
|
|
|
|
8811
|
|
9
|
|
|
|
|
|
|
|
10
|
109
|
|
|
109
|
|
659
|
use Validation::Class::Util; |
|
109
|
|
|
|
|
235
|
|
|
109
|
|
|
|
|
625
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900058'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 0; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub normalize { |
20
|
|
|
|
|
|
|
|
21
|
1009
|
|
|
1009
|
0
|
2052
|
my ($self, $proto, $field) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# static help-text may contain multiline strings for the sake of |
24
|
|
|
|
|
|
|
# aesthetics, flatten them here |
25
|
|
|
|
|
|
|
|
26
|
1009
|
50
|
|
|
|
2451
|
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
|
1009
|
|
|
|
|
2039
|
return $self; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |