line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Rose::Conf::Root; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1669
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
77
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use Carp(); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
387
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import |
10
|
|
|
|
|
|
|
{ |
11
|
3
|
|
|
3
|
|
116
|
my($class, $dir) = @_; |
12
|
|
|
|
|
|
|
|
13
|
3
|
50
|
|
|
|
10
|
if(@_ < 2) |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
|
|
0
|
local $Carp::CarpLevel = 0; |
16
|
0
|
|
|
|
|
0
|
Carp::croak "Usage: use $class '/some/directory'"; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else |
19
|
|
|
|
|
|
|
{ |
20
|
3
|
50
|
|
|
|
10
|
if(defined $dir) |
21
|
|
|
|
|
|
|
{ |
22
|
3
|
50
|
|
|
|
85
|
unless(-d $dir) |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
|
|
0
|
local $Carp::CarpLevel = 0; |
25
|
0
|
|
|
|
|
0
|
Carp::croak "No such directory: $dir"; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
31
|
$ENV{'ROSE_CONF_FILE_ROOT'} = $dir; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
else |
31
|
|
|
|
|
|
|
{ |
32
|
0
|
|
|
|
|
0
|
delete $ENV{'ROSE_CONF_FILE_ROOT'}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub conf_root |
38
|
|
|
|
|
|
|
{ |
39
|
4
|
100
|
|
4
|
1
|
934
|
return $ENV{'ROSE_CONF_FILE_ROOT'} unless(@_ > 1); |
40
|
2
|
|
|
|
|
10
|
shift->import(@_); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |