| 1 | package Cinnamon::Local; | ||
| 2 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 2 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 2 | ▶ | use IPC::Run (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | use Cinnamon::Logger; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 0 | ▶ | sub execute { |
|
Subroutine
execute: not called CC=4 SCAR=30.0
Pod
undocumented
| |||
| 12 | 0 | my ($self, $commands, $opts) = @_; | |
| 13 | 0 | my $result = IPC::Run::run $commands, \my $stdin, \my $stdout, \my $stderr; | |
| 14 | 0 | chomp for ($stdout, $stderr); | |
| 15 | |||
| 16 | 0 | for my $line (split "\n", $stdout) { | |
| 17 | 0 | log info => sprintf "[localhost :: stdout] %s", | |
| 18 | $line; | ||
| 19 | } | ||
| 20 | 0 | for my $line (split "\n", $stderr) { | |
| 21 | 0 | log info => sprintf "[localhost :: stderr] %s", | |
| 22 | $line; | ||
| 23 | } | ||
| 24 | |||
| 25 | +{ | ||
| 26 | 0 | stdout => $stdout, | |
| 27 | stderr => $stderr, | ||
| 28 | has_error => $? > 0, | ||
| 29 | error => $?, | ||
| 30 | }; | ||
| 31 | } | ||
| 32 | |||
| 33 | 2 | !!1; | |