| 1 | package Bat::Interpreter::Delegate::Executor::DryRunner; | ||
| 2 | |||
| 3 | use utf8; | ||
| 4 | |||
| 5 | use Moo; | ||
| 6 | use Types::Standard qw(ArrayRef); | ||
| 7 | use namespace::autoclean; | ||
| 8 | |||
| 9 | with 'Bat::Interpreter::Role::Executor'; | ||
| 10 | |||
| 11 | our $VERSION = '0.025'; # VERSION | ||
| 12 | |||
| 13 | has 'commands_executed' => ( is => 'ro', | ||
| 14 | isa => ArrayRef, | ||
| 15 | default => sub { [] }, | ||
| 16 | ); | ||
| 17 | |||
| 18 | sub add_command { | ||
| 19 | push @{ shift->commands_executed }, @_; | ||
| 20 | } | ||
| 21 | |||
| 22 | has 'for_commands_executed' => ( is => 'ro', | ||
| 23 | isa => ArrayRef, | ||
| 24 | default => sub { [] }, | ||
| 25 | ); | ||
| 26 | |||
| 27 | sub add_for_command { | ||
| 28 | push @{ shift->for_commands_executed }, @_; | ||
| 29 | } | ||
| 30 | |||
| 31 | sub execute_command { | ||
| 32 | my $self = shift(); | ||
| 33 | my $command = shift(); | ||
| 34 | $self->add_command($command); | ||
| 35 | return 0; | ||
| 36 | } | ||
| 37 | |||
| 38 | sub execute_for_command { | ||
| 39 | my $self = shift(); | ||
| 40 | my $command = shift(); | ||
| 41 | $self->add_for_command($command); | ||
| 42 | return ''; # | ||
| 43 | } | ||
| 44 | |||
| 45 | 1; | ||
| 46 | |||
| 47 | __END__ |