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   21 use feature qw/say/;
  6         5  
  6         306  
3 6     6   21 use Moo;
  6         6  
  6         19  
4              
5 6     6   1074 use Chef::Knife::Cmd::Node::RunList;
  6         8  
  6         96  
6 6     6   1868 use Chef::Knife::Cmd::Node::From;
  6         9  
  6         1767  
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   636 sub _build_run_list { Chef::Knife::Cmd::Node::RunList->new(knife => shift) }
13 1     1   664 sub _build_from { Chef::Knife::Cmd::Node::From->new(knife => shift) }
14              
15             sub show {
16 1     1 0 747 my ($self, $node, %options) = @_;
17 1         5 my @opts = $self->handle_options(%options);
18 1         3 my @cmd = (qw/knife node show/, $node, @opts);
19 1         3 $self->run(@cmd);
20             }
21              
22             sub delete {
23 1     1 0 371 my ($self, $node, %options) = @_;
24 1         15 my @opts = $self->handle_options(%options);
25 1         3 my @cmd = (qw/knife node delete/, $node, @opts);
26 1         13 $self->run(@cmd);
27             }
28              
29             sub create {
30 1     1 0 453 my ($self, $node, %options) = @_;
31 1         15 my @opts = $self->handle_options(%options);
32 1         2 my @cmd = (qw/knife node create/, $node, @opts);
33 1         14 $self->run(@cmd);
34             }
35              
36             sub list {
37 1     1 0 344 my ($self, $node, %options) = @_;
38 1         14 my @opts = $self->handle_options(%options);
39 1         2 my @cmd = (qw/knife node list/, @opts);
40 1         14 $self->run(@cmd);
41             }
42              
43             sub flip {
44 1     1 0 354 my ($self, $node, $environment, %options) = @_;
45 1         15 my @opts = $self->handle_options(%options);
46 1         4 my @cmd = (qw/knife node flip/, $node, $environment, @opts);
47 1         13 $self->run(@cmd);
48             }
49              
50             1;