line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Morpheus::Plugin::Env; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Morpheus::Plugin::Env::VERSION = '0.46'; |
4
|
|
|
|
|
|
|
} |
5
|
4
|
|
|
4
|
|
20
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
136
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: plugin which provides config values based on MORPHEUS env variable |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
21
|
use base qw(Morpheus::Plugin::Content); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
13642
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub list ($$) { |
12
|
144
|
|
|
144
|
0
|
237
|
my ($class, $ns) = @_; |
13
|
144
|
|
|
|
|
642
|
return ('' => 'MORPHEUS'); #TODO: configure like (ENV_VAR1 => '/key1/', ENV_VAR2 => '/key2/subkey/', ...) |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub content ($$) { |
17
|
142
|
|
|
142
|
0
|
534
|
my ($self, $token) = @_; |
18
|
142
|
50
|
|
|
|
409
|
die if $token ne 'MORPHEUS'; |
19
|
142
|
100
|
|
|
|
323
|
return $ENV{MORPHEUS} if $ENV{MORPHEUS}; |
20
|
141
|
|
|
|
|
299
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |