| 1 | package Rose::Conf::Root; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 2 | ▶ | use Carp(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 2 | our $VERSION = '0.01'; | |||||||||
| 8 | |||||||||||
| 9 | sub import | ||||||||||
| 10 | 3 | ▶ | { | ||||||||
|
Subroutine
import: called CC=4 SCAR=17.9
| |||||||||||
| 11 | 3 | my($class, $dir) = @_; | |||||||||
| 12 | |||||||||||
| 13 | 3 | ▶ | if(@_ < 2) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | { | ||||||||||
| 15 | 0 | local $Carp::CarpLevel = 0; | |||||||||
| 16 | 0 | Carp::croak "Usage: use $class '/some/directory'"; | |||||||||
| 17 | } | ||||||||||
| 18 | else | ||||||||||
| 19 | { | ||||||||||
| 20 | 3 | ▶ | if(defined $dir) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | { | ||||||||||
| 22 | 3 | ▶ | unless(-d $dir) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | { | ||||||||||
| 24 | 0 | local $Carp::CarpLevel = 0; | |||||||||
| 25 | 0 | Carp::croak "No such directory: $dir"; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 3 | $ENV{'ROSE_CONF_FILE_ROOT'} = $dir; | |||||||||
| 29 | } | ||||||||||
| 30 | else | ||||||||||
| 31 | { | ||||||||||
| 32 | 0 | delete $ENV{'ROSE_CONF_FILE_ROOT'}; | |||||||||
| 33 | } | ||||||||||
| 34 | } | ||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | sub conf_root | ||||||||||
| 38 | 4 | ▶ | { | ||||||||
|
Subroutine
conf_root: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 39 | 4 | ▶ | return $ENV{'ROSE_CONF_FILE_ROOT'} unless(@_ > 1); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 2 | shift->import(@_); | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 2 | 1; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||