| 1 | package TaskPipe::RunInfo; | ||
| 2 | |||
| 3 | 42 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 42 | ▶ | use MooseX::ClassAttribute; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 42 | ▶ | use TaskPipe::Role::MooseType_ShellMode; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 42 | ▶ | use TaskPipe::Role::MooseType_ScopeMode; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 42 | class_has scope => (is => 'rw', isa => 'ScopeMode', default => 'project'); | |
| 9 | 42 | class_has shell => (is => 'rw', isa => 'ShellMode', default => 'foreground'); | |
| 10 | 42 | class_has cmd => (is => 'rw', isa => 'ArrayRef'); | |
| 11 | 42 | class_has orig_cmd => (is => 'rw', isa => 'ArrayRef'); | |
| 12 | 42 | class_has root_dir => (is => 'rw', isa => 'Str'); | |
| 13 | 42 | class_has job_id => (is => 'rw', isa => 'Int'); | |
| 14 | #class_has run_id => (is => 'rw', isa => 'Int'); | ||
| 15 | 42 | class_has thread_id => (is => 'rw', isa => 'Int',default => 0); | |
| 16 | 42 | class_has task_name => (is => 'rw', isa => 'Str'); | |
| 17 | 42 | class_has task_details => (is => 'rw', isa => 'Str'); | |
| 18 | |||
| 19 | sub as_string{ | ||
| 20 | 0 | ▶ | my ($self) = @_; |
|
Subroutine
as_string: not called CC=2 SCAR=17.9
Pod
undocumented
| |||
| 21 | |||
| 22 | 0 | my @out; | |
| 23 | 0 | foreach my $info_item ( qw(orig_cmd job_id thread_id task_name) ){ | |
| 24 | 0 | push @out, "$info_item: ".$self->$info_item; | |
| 25 | } | ||
| 26 | 0 | return +join(' ',@out); | |
| 27 | } | ||
| 28 | |||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | TaskPipe::RunInfo - information about the run (of the current plan) | ||
| 33 | |||
| 34 | =head1 DESCRIPTION | ||
| 35 | |||
| 36 | provides run information (job_id, thread_id etc.) for the current job/thread | ||
| 37 | |||
| 38 | =head1 AUTHOR | ||
| 39 | |||
| 40 | Tom Gracey <tomgracey@gmail.com> | ||
| 41 | |||
| 42 | =head1 COPYRIGHT AND LICENSE | ||
| 43 | |||
| 44 | Copyright (c) Tom Gracey 2018 | ||
| 45 | |||
| 46 | TaskPipe is free software, licensed under | ||
| 47 | |||
| 48 | The GNU Public License Version 3 | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | 42 | 1; | |