File Coverage

blib/lib/Chef/Knife/Cmd/Node.pm
Criterion Covered Total %
statement 34 34 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod 0 5 0.0
total 45 50 90.0


line stmt bran cond sub pod time code
1             package Chef::Knife::Cmd::Node;
2 6     6   26 use feature qw/say/;
  6         8  
  6         487  
3 6     6   24 use Moo;
  6         5  
  6         30  
4              
5 6     6   1769 use Chef::Knife::Cmd::Node::RunList;
  6         14  
  6         157  
6 6     6   2334 use Chef::Knife::Cmd::Node::From;
  6         14  
  6         2469  
7              
8             has knife => (is => 'ro', required => 1, handles => [qw/handle_options run/]);
9             has run_list => (is => 'lazy');
10             has from => (is => 'lazy');
11              
12 1     1   503 sub _build_run_list { Chef::Knife::Cmd::Node::RunList->new(knife => shift) }
13 1     1   599 sub _build_from { Chef::Knife::Cmd::Node::From->new(knife => shift) }
14              
15             sub show {
16 1     1 0 884 my ($self, $node, %options) = @_;
17 1         19 my @opts = $self->handle_options(%options);
18 1         3 my @cmd = (qw/knife node show/, $node, @opts);
19 1         16 $self->run(@cmd);
20             }
21              
22             sub delete {
23 1     1 0 504 my ($self, $node, %options) = @_;
24 1         16 my @opts = $self->handle_options(%options);
25 1         4 my @cmd = (qw/knife node delete/, $node, @opts);
26 1         15 $self->run(@cmd);
27             }
28              
29             sub create {
30 1     1 0 991 my ($self, $node, %options) = @_;
31 1         16 my @opts = $self->handle_options(%options);
32 1         3 my @cmd = (qw/knife node create/, $node, @opts);
33 1         15 $self->run(@cmd);
34             }
35              
36             sub list {
37 1     1 0 487 my ($self, $node, %options) = @_;
38 1         16 my @opts = $self->handle_options(%options);
39 1         4 my @cmd = (qw/knife node list/, @opts);
40 1         14 $self->run(@cmd);
41             }
42              
43             sub flip {
44 1     1 0 529 my ($self, $node, $environment, %options) = @_;
45 1         16 my @opts = $self->handle_options(%options);
46 1         4 my @cmd = (qw/knife node flip/, $node, $environment, @opts);
47 1         14 $self->run(@cmd);
48             }
49              
50             1;