| 1 | 1 | ▶ | use 5.008; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | |||||||||||||||
| 5 | package Class::Scaffold::Context; | ||||||||||||||
| 6 | 1 | ▶ | BEGIN { | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 1 | $Class::Scaffold::Context::VERSION = '1.102280'; | |||||||||||||
| 8 | } | ||||||||||||||
| 9 | # ABSTRACT: Holds execution and job context | ||||||||||||||
| 10 | 1 | ▶ | use parent 'Class::Scaffold::Base'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | 1 | __PACKAGE__->mk_scalar_accessors(qw(execution job)); | |||||||||||||
| 12 | |||||||||||||||
| 13 | # types of execution context: cron, apache, shell, soap | ||||||||||||||
| 14 | # types of job context: mail, sif, epp | ||||||||||||||
| 15 | # takes something like 'run/epp' and sets execution and job context | ||||||||||||||
| 16 | 0 | ▶ | sub parse_context { | ||||||||||||
|
Subroutine
parse_context: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||
| 17 | 0 | my ($self, $spec) = @_; | |||||||||||||
| 18 | 0 | ▶ | if ($spec =~ m!^(\w+)/(\w+)$!) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 19 | 0 | my ($job, $execution) = ($1, $2); | |||||||||||||
| 20 | 0 | $self->execution($execution); | |||||||||||||
| 21 | 0 | $self->job($job); | |||||||||||||
| 22 | } else { | ||||||||||||||
| 23 | 0 | throw Error::Hierarchy::Internal::CustomMessage( | |||||||||||||
| 24 | custom_message => "Invalid context specification [$spec]",); | ||||||||||||||
| 25 | } | ||||||||||||||
| 26 | 0 | $self; | |||||||||||||
| 27 | } | ||||||||||||||
| 28 | |||||||||||||||
| 29 | 0 | ▶ | sub as_string { | ||||||||||||
|
Subroutine
as_string: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||
| 30 | 0 | my $self = shift; | |||||||||||||
| 31 | 0 | ▶ | sprintf '%s/%s', | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 32 | (defined $self->job ? $self->job : 'none'), | ||||||||||||||
| 33 | (defined $self->execution ? $self->execution : 'none'); | ||||||||||||||
| 34 | } | ||||||||||||||
| 35 | 1 | 1; | |||||||||||||
| 36 | |||||||||||||||
| 37 | |||||||||||||||
| 38 | __END__ | ||||||||||||||