line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SmokeRunner::Multi::Config; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
10
|
|
|
10
|
|
56019
|
$SmokeRunner::Multi::Config::AUTHORITY = 'cpan:YANICK'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$SmokeRunner::Multi::Config::VERSION = '0.19'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
#ABSTRACT: Config information for a Smokerunner::Multi setup |
9
|
|
|
|
|
|
|
|
10
|
10
|
|
|
10
|
|
60
|
use strict; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
463
|
|
11
|
10
|
|
|
10
|
|
50
|
use warnings; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
325
|
|
12
|
|
|
|
|
|
|
|
13
|
10
|
|
|
10
|
|
61
|
use base 'Class::Singleton'; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
9782
|
|
14
|
|
|
|
|
|
|
|
15
|
10
|
|
|
10
|
|
10378
|
use File::Spec; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
211
|
|
16
|
10
|
|
|
10
|
|
10006
|
use File::HomeDir; |
|
10
|
|
|
|
|
61007
|
|
|
10
|
|
|
|
|
730
|
|
17
|
10
|
|
|
10
|
|
7353
|
use YAML::Syck qw( LoadFile ); |
|
10
|
|
|
|
|
26769
|
|
|
10
|
|
|
|
|
3887
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _new_instance |
20
|
|
|
|
|
|
|
{ |
21
|
14
|
|
|
14
|
|
3721
|
my $class = shift; |
22
|
|
|
|
|
|
|
|
23
|
14
|
|
|
|
|
74
|
my $file = $class->_FindConfigFile(); |
24
|
|
|
|
|
|
|
|
25
|
12
|
|
|
|
|
72
|
my $cfg = LoadFile($file); |
26
|
|
|
|
|
|
|
|
27
|
12
|
100
|
66
|
|
|
2318
|
die "Config in $file for the smoke-runner was not valid.\n" |
28
|
|
|
|
|
|
|
unless $cfg && $cfg->{root}; |
29
|
|
|
|
|
|
|
|
30
|
11
|
|
|
|
|
68
|
return bless $cfg, $class; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _FindConfigFile |
34
|
|
|
|
|
|
|
{ |
35
|
14
|
|
|
14
|
|
37
|
my $class = shift; |
36
|
|
|
|
|
|
|
|
37
|
14
|
|
|
|
|
66
|
my @files = ( |
38
|
|
|
|
|
|
|
$class->_config_from_env, |
39
|
|
|
|
|
|
|
$class->_config_from_home, |
40
|
|
|
|
|
|
|
$class->_config_from_system, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
14
|
|
|
|
|
51
|
for my $file (@files) |
44
|
|
|
|
|
|
|
{ |
45
|
15
|
100
|
66
|
|
|
451
|
return $file if -f $file && -r _; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
2
|
|
|
|
|
23
|
die "Cannot find a config file for the smoke-runner. Looked in [@files].\n"; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub _config_from_env { |
52
|
14
|
100
|
|
14
|
|
131
|
return $ENV{SMOKERUNNER_CONFIG} if $ENV{SMOKERUNNER_CONFIG}; |
53
|
|
|
|
|
|
|
|
54
|
1
|
|
|
|
|
4
|
return; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _config_from_home { |
58
|
10
|
|
|
10
|
|
101
|
return File::Spec->catfile( File::HomeDir->my_home , '.smokerunner', |
59
|
|
|
|
|
|
|
'smokerunner.conf' ); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
14
|
|
|
14
|
|
582
|
sub _config_from_system { return '/etc/smokerunner/smokerunner.conf' } |
63
|
|
|
|
|
|
|
|
64
|
20
|
|
|
20
|
1
|
1550
|
sub root_dir { return $_[0]->{root} } |
65
|
2
|
|
|
2
|
1
|
44
|
sub runner { return $_[0]->{runner} } |
66
|
3
|
|
|
3
|
1
|
58
|
sub reporter { return $_[0]->{reporter} } |
67
|
7
|
|
100
|
7
|
1
|
2128
|
sub smolder { return $_[0]->{smolder} || {} } |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |