File Coverage

blib/lib/Chef/Knife/Cmd/Vault.pm
Criterion Covered Total %
statement 31 31 100.0
branch 3 6 50.0
condition n/a
subroutine 6 6 100.0
pod 0 5 0.0
total 40 48 83.3


line stmt bran cond sub pod time code
1             package Chef::Knife::Cmd::Vault;
2 6     6   21 use Moo;
  6         8  
  6         20  
3              
4             has knife => (is => 'ro', required => 1, handles => [qw/handle_options run/]);
5              
6             sub create {
7 1     1 0 644 my ($self, $vault, $item, $values, %options) = @_;
8 1         4 my @opts = $self->handle_options(%options);
9 1         3 my @cmd = (qw/knife vault create/, $vault, $item);
10 1 50       6 push @cmd, $values if $values;
11 1         2 push @cmd, @opts;
12 1         4 $self->run(@cmd);
13             }
14              
15             sub update {
16 1     1 0 505 my ($self, $vault, $item, $values, %options) = @_;
17 1         15 my @opts = $self->handle_options(%options);
18 1         2 my @cmd = (qw/knife vault update/, $vault, $item);
19 1 50       3 push @cmd, $values if $values;
20 1         2 push @cmd, @opts;
21 1         15 $self->run(@cmd);
22             }
23              
24             sub delete {
25 1     1 0 341 my ($self, $vault, $item, %options) = @_;
26 1         14 my @opts = $self->handle_options(%options);
27 1         3 my @cmd = (qw/knife vault delete/, $vault, $item);
28 1         2 push @cmd, @opts;
29 1         14 $self->run(@cmd);
30             }
31              
32             sub show {
33 1     1 0 344 my ($self, $vault, $item, %options) = @_;
34 1         14 my @opts = $self->handle_options(%options);
35 1         4 my @cmd = (qw/knife vault show/, $vault);
36 1 50       4 push @cmd, $item if $item;
37 1         1 push @cmd, @opts;
38 1         14 $self->run(@cmd);
39             }
40              
41             sub list {
42 1     1 0 317 my ($self, %options) = @_;
43 1         14 my @opts = $self->handle_options(%options);
44 1         3 my @cmd = (qw/knife vault list/);
45 1         1 push @cmd, @opts;
46 1         14 $self->run(@cmd);
47             }
48              
49             1;