File Coverage

blib/lib/Pinto/Action/Rename.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: Change the name of a stack
2              
3             package Pinto::Action::Rename;
4              
5 1     1   571 use Moose;
  1         2  
  1         10  
6 1     1   7547 use MooseX::StrictConstructor;
  1         4  
  1         15  
7 1     1   3445 use MooseX::MarkAsMethods ( autoclean => 1 );
  1         3  
  1         12  
8              
9 1     1   3523 use Pinto::Types qw(StackName StackObject);
  1         2  
  1         24  
10              
11             #------------------------------------------------------------------------------
12              
13             our $VERSION = '0.13'; # VERSION
14              
15             #------------------------------------------------------------------------------
16              
17             extends qw( Pinto::Action );
18              
19             #------------------------------------------------------------------------------
20              
21             with qw( Pinto::Role::Transactional );
22              
23             #------------------------------------------------------------------------------
24              
25             has stack => (
26             is => 'ro',
27             isa => StackName | StackObject,
28             required => 1,
29             );
30              
31             has to_stack => (
32             is => 'ro',
33             isa => StackName,
34             required => 1,
35             );
36              
37             #------------------------------------------------------------------------------
38              
39             sub execute {
40             my ($self) = @_;
41              
42             my $stack = $self->repo->get_stack( $self->stack );
43              
44             $self->repo->rename_stack( stack => $stack, to => $self->to_stack );
45              
46             return $self->result->changed;
47             }
48              
49             #------------------------------------------------------------------------------
50              
51             __PACKAGE__->meta->make_immutable;
52              
53             #------------------------------------------------------------------------------
54              
55             1;
56              
57             __END__
58              
59             =pod
60              
61             =encoding UTF-8
62              
63             =for :stopwords Jeffrey Ryan Thalhammer
64              
65             =head1 NAME
66              
67             Pinto::Action::Rename - Change the name of a stack
68              
69             =head1 VERSION
70              
71             version 0.13
72              
73             =head1 AUTHOR
74              
75             Jeffrey Ryan Thalhammer <jeff@stratopan.com>
76              
77             =head1 COPYRIGHT AND LICENSE
78              
79             This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer.
80              
81             This is free software; you can redistribute it and/or modify it under
82             the same terms as the Perl 5 programming language system itself.
83              
84             =cut