blib/lib/Terse/Plugin/Config/YAML.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 6 | 12 | 50.0 |
branch | 0 | 2 | 0.0 |
condition | n/a | ||
subroutine | 2 | 3 | 66.6 |
pod | 0 | 1 | 0.0 |
total | 8 | 18 | 44.4 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Terse::Plugin::Config::YAML; | ||||||
2 | |||||||
3 | 1 | 1 | 906 | use base 'Terse::Plugin::Config'; | |||
1 | 2 | ||||||
1 | 100 | ||||||
4 | |||||||
5 | 1 | 1 | 424 | use YAML::XS qw/LoadFile/; | |||
1 | 2886 | ||||||
1 | 148 | ||||||
6 | |||||||
7 | sub build_plugin { | ||||||
8 | 0 | 0 | 0 | my ($self) = @_; | |||
9 | 0 | 0 | if (!$self->config_file) { | ||||
10 | 0 | my $file = $0; | |||||
11 | 0 | ($self->config_file = $0) =~ s/(\.psgi)?$/.yml/; | |||||
12 | } | ||||||
13 | 0 | $self->data = LoadFile $self->config_file; | |||||
14 | 0 | return $self; | |||||
15 | } | ||||||
16 | |||||||
17 | 1; | ||||||
18 | |||||||
19 | __END__ |