File Coverage

blib/lib/Etcd3/Config.pm
Criterion Covered Total %
statement 15 27 55.5
branch 0 2 0.0
condition n/a
subroutine 5 8 62.5
pod 2 2 100.0
total 22 39 56.4


line stmt bran cond sub pod time code
1 3     3   11 use utf8;
  3         3  
  3         12  
2             package Etcd3::Config;
3              
4 3     3   90 use strict;
  3         3  
  3         44  
5 3     3   8 use warnings;
  3         3  
  3         53  
6              
7 3     3   9 use Moo;
  3         8  
  3         11  
8 3     3   526 use namespace::clean;
  3         4  
  3         15  
9              
10             =head1 NAME
11              
12             Etcd3::Config
13              
14             =cut
15              
16             our $VERSION = '0.001';
17              
18             =head2 etcd
19              
20             =cut
21              
22             has etcd => ( is => 'lazy' );
23              
24             sub _build_etcd {
25 0     0     my $self = shift;
26 0           my $found = `which etcd`;
27 0 0         if ( $? == 0 ) {
28 0           chomp($found);
29 0           return $found;
30             }
31 0           return;
32             }
33              
34             =head2 configuration
35              
36             =cut
37              
38             sub configuration {
39 0     0 1   return Etcd3::Config->new;
40             }
41              
42             =head2 configure
43              
44             =cut
45              
46             sub configure {
47 0     0 1   my $class = shift;
48 0           my $code = shift;
49 0           local $_ = $class->configuration;
50 0           $code->($_);
51 0           return;
52             }
53              
54             1;