blib/lib/Pinto/Action/Rename.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 28 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/App/Pinto/Command/verify.pm ↑ Summary blib/lib/Pinto/Constants.pm »
1 # ABSTRACT: Change the name of a stack
2  
3 package Pinto::Action::Rename;
4  
5 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use MooseX::MarkAsMethods ( autoclean => 1 );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use Pinto::Types qw(StackName StackObject);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 #------------------------------------------------------------------------------
12  
13 2 our $VERSION = '0.14'; # VERSION
14  
15 #------------------------------------------------------------------------------
16  
17 2 extends qw( Pinto::Action );
18  
19 #------------------------------------------------------------------------------
20  
21 2 with qw( Pinto::Role::Transactional );
22  
23 #------------------------------------------------------------------------------
24  
25 2 has stack => (
26 is => 'ro',
27 isa => StackName | StackObject,
28 required => 1,
29 );
30  
31 2 has to_stack => (
32 is => 'ro',
33 isa => StackName,
34 required => 1,
35 );
36  
37 #------------------------------------------------------------------------------
38  
39 5 ▶sub execute {
Subroutine execute: called CC=1 SCAR=0.0
40 5 my ($self) = @_;
41  
42 5 my $stack = $self->repo->get_stack( $self->stack );
43  
44 4 $self->repo->rename_stack( stack => $stack, to => $self->to_stack );
45  
46 2 return $self->result->changed;
47 }
48  
49 #------------------------------------------------------------------------------
50  
51 2 __PACKAGE__->meta->make_immutable;
52  
53 #------------------------------------------------------------------------------
54  
55 2 1;
56  
57 __END__
« blib/lib/App/Pinto/Command/verify.pm ↑ Summary blib/lib/Pinto/Constants.pm »