| 1 | package Beam::Runner::Steps; | ||||||||||
| 2 | 2 | our $VERSION = '0.016'; | |||||||||
| 3 | # ABSTRACT: Run a series of steps | ||||||||||
| 4 | |||||||||||
| 5 | #pod =head1 SYNOPSIS | ||||||||||
| 6 | #pod | ||||||||||
| 7 | #pod beam run <container> <service> | ||||||||||
| 8 | #pod | ||||||||||
| 9 | #pod =head1 DESCRIPTION | ||||||||||
| 10 | #pod | ||||||||||
| 11 | #pod This runnable module runs a series of other runnable modules in | ||||||||||
| 12 | #pod sequence. If any module returns a non-zero value, the steps stop. | ||||||||||
| 13 | #pod | ||||||||||
| 14 | #pod =head1 SEE ALSO | ||||||||||
| 15 | #pod | ||||||||||
| 16 | #pod L<beam>, L<Beam::Runnable> | ||||||||||
| 17 | #pod | ||||||||||
| 18 | #pod =cut | ||||||||||
| 19 | |||||||||||
| 20 | 2 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 2 | with 'Beam::Runnable'; | |||||||||
| 23 | 2 | ▶ | use Types::Standard qw( ArrayRef ConsumerOf ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | |||||||||||
| 25 | #pod =attr steps | ||||||||||
| 26 | #pod | ||||||||||
| 27 | #pod The steps to run. Must be an arrayref of L<Beam::Runnable> objects. | ||||||||||
| 28 | #pod | ||||||||||
| 29 | #pod =cut | ||||||||||
| 30 | |||||||||||
| 31 | 2 | has steps => ( | |||||||||
| 32 | is => 'ro', | ||||||||||
| 33 | isa => ArrayRef[ConsumerOf['Beam::Runnable']], | ||||||||||
| 34 | required => 1, | ||||||||||
| 35 | ); | ||||||||||
| 36 | |||||||||||
| 37 | 2 | ▶ | sub run { | ||||||||
|
Subroutine
run: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 38 | 2 | my ( $self, @args ) = @_; | |||||||||
| 39 | 2 | for my $step ( @{ $self->steps } ) { | |||||||||
| 40 | 4 | my $exit = $step->run( @args ); | |||||||||
| 41 | 4 | ▶ | return $exit if $exit != 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | } | ||||||||||
| 43 | 1 | return 0; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 2 | 1; | |||||||||
| 47 | |||||||||||
| 48 | __END__ | ||||||||||