line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Morpheus::Plugin::Simple; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Morpheus::Plugin::Simple::VERSION = '0.46'; |
4
|
|
|
|
|
|
|
} |
5
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
144
|
|
6
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
108
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: plugin for simple static configuration |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
19
|
use Morpheus::Utils qw(normalize); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1543
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new ($$) { |
13
|
12
|
|
|
12
|
0
|
27
|
my ($class, $data) = @_; |
14
|
12
|
|
|
|
|
24
|
my $_data = $data; |
15
|
12
|
100
|
|
8
|
|
74
|
$data = sub { $_data } unless ref $data eq "CODE"; |
|
8
|
|
|
|
|
25
|
|
16
|
12
|
|
|
|
|
70
|
bless { |
17
|
|
|
|
|
|
|
data => $data, |
18
|
|
|
|
|
|
|
} => $class; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub list ($$) { |
22
|
478
|
|
|
478
|
0
|
1987
|
return ('' => ''); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub get ($$) { |
26
|
478
|
|
|
478
|
0
|
680
|
my ($self, $token) = @_; |
27
|
478
|
50
|
|
|
|
899
|
die 'mystery' if $token; |
28
|
|
|
|
|
|
|
|
29
|
478
|
100
|
|
|
|
1319
|
if (ref $self->{data} eq "CODE") { |
30
|
12
|
|
|
|
|
33
|
$self->{data} = normalize($self->{data}->()); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
478
|
|
|
|
|
2006
|
return $self->{data}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |