line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
1536
|
use 5.001001; |
|
3
|
|
|
|
|
14
|
|
2
|
|
|
|
|
|
|
package Mojolicious::Plugin::SQLiteViewerLite::Base; |
3
|
3
|
|
|
3
|
|
21
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
25
|
|
4
|
3
|
|
|
3
|
|
1789
|
use DBIx::Custom; |
|
3
|
|
|
|
|
51907
|
|
|
3
|
|
|
|
|
39
|
|
5
|
3
|
|
|
3
|
|
1705
|
use Validator::Custom; |
|
3
|
|
|
|
|
39261
|
|
|
3
|
|
|
|
|
21
|
|
6
|
3
|
|
|
3
|
|
108
|
use File::Basename 'dirname'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
189
|
|
7
|
3
|
|
|
3
|
|
20
|
use Cwd 'abs_path'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
106
|
|
8
|
3
|
|
|
3
|
|
17
|
use Carp 'croak'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1204
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'prefix'; |
11
|
|
|
|
|
|
|
has validator => sub { |
12
|
|
|
|
|
|
|
my $validator = Validator::Custom->new; |
13
|
|
|
|
|
|
|
$validator->register_constraint( |
14
|
|
|
|
|
|
|
safety_name => sub { |
15
|
|
|
|
|
|
|
my $name = shift; |
16
|
|
|
|
|
|
|
return ($name || '') =~ /^\w+$/ ? 1 : 0; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
return $validator; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has dbi => sub { DBIx::Custom->new }; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has command => sub { croak "Unimplemented" }; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
0
|
sub register { croak "Unimplemented" } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub add_template_path { |
29
|
3
|
|
|
3
|
0
|
40
|
my ($self, $renderer, $class) = @_; |
30
|
3
|
|
|
|
|
22
|
$class =~ s/::/\//g; |
31
|
3
|
|
|
|
|
7
|
$class .= '.pm'; |
32
|
3
|
|
|
|
|
207
|
my $public = abs_path $INC{$class}; |
33
|
3
|
|
|
|
|
17
|
$public =~ s/\.pm$//; |
34
|
3
|
|
|
|
|
6
|
push @{$renderer->paths}, "$public/templates"; |
|
3
|
|
|
|
|
17
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_static_path { |
38
|
3
|
|
|
3
|
0
|
30
|
my ($self, $static, $class) = @_; |
39
|
3
|
|
|
|
|
16
|
$class =~ s/::/\//g; |
40
|
3
|
|
|
|
|
8
|
$class .= '.pm'; |
41
|
3
|
|
|
|
|
150
|
my $public = abs_path $INC{$class}; |
42
|
3
|
|
|
|
|
14
|
$public =~ s/\.pm$//; |
43
|
3
|
|
|
|
|
9
|
push @{$static->paths}, "$public/public"; |
|
3
|
|
|
|
|
15
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |