line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer::Hook::Properties; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:SUKRIA'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Properties attached to a hook |
4
|
|
|
|
|
|
|
$Dancer::Hook::Properties::VERSION = '1.3514_04'; # TRIAL |
5
|
|
|
|
|
|
|
$Dancer::Hook::Properties::VERSION = '1.351404'; |
6
|
166
|
|
|
166
|
|
1448
|
use strict; |
|
166
|
|
|
|
|
326
|
|
|
166
|
|
|
|
|
3981
|
|
7
|
166
|
|
|
166
|
|
703
|
use warnings; |
|
166
|
|
|
|
|
296
|
|
|
166
|
|
|
|
|
3534
|
|
8
|
|
|
|
|
|
|
|
9
|
166
|
|
|
166
|
|
734
|
use base 'Dancer::Object'; |
|
166
|
|
|
|
|
333
|
|
|
166
|
|
|
|
|
45809
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Dancer::Hook::Properties->attributes(qw/apps/); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
133
|
|
|
133
|
1
|
249
|
my ($self, %args) = @_; |
15
|
|
|
|
|
|
|
|
16
|
133
|
|
|
|
|
371
|
$self->_init_apps(\%args); |
17
|
133
|
|
|
|
|
270
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _init_apps { |
21
|
133
|
|
|
133
|
|
247
|
my ( $self, $args ) = @_; |
22
|
133
|
50
|
|
|
|
301
|
if ( my $apps = $args->{'apps'} ) { |
23
|
0
|
0
|
|
|
|
0
|
ref $apps ? $self->apps($apps) : $self->apps( [$apps] ); |
24
|
0
|
|
|
|
|
0
|
return; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
else { |
27
|
133
|
|
|
|
|
736
|
$self->apps( [] ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub should_run_this_app { |
32
|
298
|
|
|
298
|
0
|
505
|
my ( $self, $app ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
298
|
50
|
|
|
|
362
|
return 1 unless scalar( @{ $self->apps } ); |
|
298
|
|
|
|
|
586
|
|
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
if ( $self->apps ) { |
37
|
0
|
|
|
|
|
|
return grep { $_ eq $app } @{ $self->apps }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |