« Interpreter/Delegate/Executor/DryRunner.pm
↑ Summary
Interpreter/Delegate/Executor/PartialDryRunner.pm »
| 1 | package Bat::Interpreter::Delegate::Executor::System; | ||
| 2 | |||
| 3 | use utf8; | ||
| 4 | |||
| 5 | use Moo; | ||
| 6 | use namespace::autoclean; | ||
| 7 | |||
| 8 | with 'Bat::Interpreter::Role::Executor'; | ||
| 9 | |||
| 10 | our $VERSION = '0.025'; # VERSION | ||
| 11 | |||
| 12 | sub execute_command { | ||
| 13 | my $self = shift(); | ||
| 14 | my $command = shift(); | ||
| 15 | return system($command); | ||
| 16 | } | ||
| 17 | |||
| 18 | sub execute_for_command { | ||
| 19 | my $self = shift(); | ||
| 20 | my $command = shift(); | ||
| 21 | my $output = `$command`; | ||
| 22 | chomp $output; | ||
| 23 | return $output; | ||
| 24 | } | ||
| 25 | |||
| 26 | 1; | ||
| 27 | |||
| 28 | __END__ |