| 1 | #!/usr/bin/env perl | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use App::Pipeline::Simple; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use Getopt::Long; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use constant PROGRAMME_NAME => 'spipe'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | # ABSTRACT: simple pipeline running interface | ||||||||||||||||||||||||||||||||
| 12 | 5 | our $VERSION = '0.9.1'; # VERSION | |||||||||||||||||||||||||||||||
| 13 | # PODNAME: spipe | ||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | # raising $OUTPUT_AUTOFLUSH flag to get immediate reporting | ||||||||||||||||||||||||||||||||
| 16 | 5 | $| = 1; | |||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | # catch interuptions cleanly | ||||||||||||||||||||||||||||||||
| 19 | 5 | $SIG{'INT'} = 'CLEANUP'; | |||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub CLEANUP { exit(1) } | ||||||||||||||||||||||||||||||
|
Subroutine
CLEANUP: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | # variables to catch command line options | ||||||||||||||||||||||||||||||||
| 24 | 5 | our $DEBUG = ''; | |||||||||||||||||||||||||||||||
| 25 | 5 | our $CONFIG = ''; | |||||||||||||||||||||||||||||||
| 26 | 5 | our $DIR = '.'; | |||||||||||||||||||||||||||||||
| 27 | 5 | our $GRAPHVIZ; | |||||||||||||||||||||||||||||||
| 28 | 5 | our $INPUT = ''; | |||||||||||||||||||||||||||||||
| 29 | 5 | our $ITYPE = ''; | |||||||||||||||||||||||||||||||
| 30 | #our $CONTINUE; # not implemented yet | ||||||||||||||||||||||||||||||||
| 31 | 5 | our $START = ''; | |||||||||||||||||||||||||||||||
| 32 | 5 | our $STOP = ''; | |||||||||||||||||||||||||||||||
| 33 | 5 | our $VERBOSE; | |||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||
| 35 | GetOptions( | ||||||||||||||||||||||||||||||||
| 36 | 1 | ▶ | 'v|version' => sub{ print PROGRAMME_NAME, ", version ", $VERSION, "\n"; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 37 | 1 | exit(1); }, | |||||||||||||||||||||||||||||||
| 38 | 'g|debug' => \$DEBUG, | ||||||||||||||||||||||||||||||||
| 39 | 'c|config:s' => \$CONFIG, | ||||||||||||||||||||||||||||||||
| 40 | 'd|directory:s' => \$DIR, | ||||||||||||||||||||||||||||||||
| 41 | 'i|input:s' => \$INPUT, | ||||||||||||||||||||||||||||||||
| 42 | 'it|itype:s' => \$ITYPE, | ||||||||||||||||||||||||||||||||
| 43 | 'graphviz' => \$GRAPHVIZ, | ||||||||||||||||||||||||||||||||
| 44 | # 'continue' => \$CONTINUE, | ||||||||||||||||||||||||||||||||
| 45 | 'start:s' => \$START, | ||||||||||||||||||||||||||||||||
| 46 | 'stop:s' => \$STOP, | ||||||||||||||||||||||||||||||||
| 47 | 'verbose:i' => \$VERBOSE, | ||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | 'h|help|?' => sub{ exec('perldoc',$0); exit(0) }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||
| 49 | 5 | ); | |||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | 3 | my %args; | |||||||||||||||||||||||||||||||
| 53 | 3 | ▶ | $args{config} = $CONFIG if $CONFIG; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 54 | 3 | $args{dir} = $DIR; | |||||||||||||||||||||||||||||||
| 55 | 3 | ▶ | $args{input} = $INPUT if $INPUT; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 56 | 3 | ▶ | $args{itype} = $ITYPE if $ITYPE; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 57 | 3 | ▶ | $args{start} = $START if $START; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 58 | 3 | ▶ | $args{stop} = $STOP if $STOP; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 59 | 3 | ▶ | $args{verbose} = $VERBOSE if $VERBOSE; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||
| 61 | 3 | ▶ | unless (-e "$DIR/config.yml" or $CONFIG ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
-e "$main::DIR/config.yml" or $main::CONFIG
MC/DC50%1/2
-e "$main::DIR/config.yml" or $main::CONFIG
-e "$main::DIR/config.yml"
$main::CONFIG
Truth table66%2/3
A or B
A= -e "$main::DIR/config.yml"B= $main::CONFIG
| |||||||||||||||||||||||||||||||||
| 62 | 1 | croak "ERROR: Need either explicit config file or ". | |||||||||||||||||||||||||||||||
| 63 | "it has to be found the working directory\n" | ||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||
| 66 | 2 | my $p = App::Pipeline::Simple->new(%args); | |||||||||||||||||||||||||||||||
| 67 | 2 | ▶ | print $p->graphviz and exit if $GRAPHVIZ; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition20%1/5
$main::GRAPHVIZ && (print($p->graphviz) && exit)
print $p->graphviz and exit
MC/DC0%0/2
$main::GRAPHVIZ && (print($p->graphviz) && exit)
$main::GRAPHVIZ
print $p->graphviz
Truth table33%1/3
A && B
A= $main::GRAPHVIZB= print $p->graphviz
| |||||||||||||||||||||||||||||||||
| 68 | 2 | ▶ | print $p->stringify and exit if $DEBUG; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition60%3/5
$main::DEBUG && (print($p->stringify) && exit)
print $p->stringify and exit
MC/DC0%0/2
$main::DEBUG && (print($p->stringify) && exit)
$main::DEBUG
print $p->stringify
Truth table33%1/3
A && B
A= $main::DEBUGB= print $p->stringify
| |||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||
| 70 | 1 | $p->run(); | |||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||
| 72 | __END__ | ||||||||||||||||||||||||||||||||