blib/lib/Pinto/Action/Unlock.pm

filter: Statementstmt 72.0% 18 / 25 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 68.7% 22 / 32 CC 2 SCAR 9.8
CC
2
Cov
67%
execute
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« blib/lib/Pinto/Locker.pm ↑ Summary blib/lib/App/Pinto/Command/copy.pm »
1 # ABSTRACT: Unlock a stack to allow future changes
2  
3 package Pinto::Action::Unlock;
4  
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use MooseX::MarkAsMethods ( autoclean => 1 );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Pinto::Types qw(StackName StackDefault StackObject);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 #------------------------------------------------------------------------------
12  
13 1 our $VERSION = '0.14'; # VERSION
14  
15 #------------------------------------------------------------------------------
16  
17 1 extends qw( Pinto::Action );
18  
19 #------------------------------------------------------------------------------
20  
21 1 with qw( Pinto::Role::Transactional );
22  
23 #------------------------------------------------------------------------------
24  
25 1 has stack => (
26 is => 'ro',
27 isa => StackName | StackDefault | StackObject,
28 default => undef,
29 );
30  
31 #------------------------------------------------------------------------------
32  
33 0 ▶sub execute {
Subroutine execute: not called CC=2 SCAR=17.9
34 0 my ($self) = @_;
35  
36 0 my $stack = $self->repo->get_stack( $self->stack );
37  
38 0 ▶ if ( !$stack->is_locked ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($stack->is_locked) 0 0 0
39 0 $self->warning("Stack $stack is not locked");
40 0 return $self->result;
41 }
42  
43 0 $stack->unlock;
44 0 return $self->result->changed;
45 }
46  
47 #------------------------------------------------------------------------------
48  
49 1 __PACKAGE__->meta->make_immutable;
50  
51 #------------------------------------------------------------------------------
52  
53 1 1;
54  
55 __END__
« blib/lib/Pinto/Locker.pm ↑ Summary blib/lib/App/Pinto/Command/copy.pm »