| 1 | package Perl::Dist::Inno::Icon; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Carp qw{ croak }; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Params::Util qw{ _IDENTIFIER _STRING }; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use vars qw{$VERSION}; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | BEGIN { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 2 | $VERSION = '1.16'; | |||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use Object::Tiny qw{ | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | name | ||||||||||||||||||||||||||||
| 16 | filename | ||||||||||||||||||||||||||||
| 17 | working_dir | ||||||||||||||||||||||||||||
| 18 | 2 | }; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | ##################################################################### | ||||||||||||||||||||||||||||
| 25 | # Constructors | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=5 SCAR=19.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 28 | 2 | my $self = shift->SUPER::new(@_); | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | # Check params | ||||||||||||||||||||||||||||
| 31 | 2 | ▶ | unless ( _STRING($self->name) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 0 | croak("Missing or invalid name param"); | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | 2 | ▶ | unless ( _STRING($self->filename) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | 0 | croak("Missing or invalid filename param"); | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | 2 | ▶ | if ( defined $self->working_dir and ! _STRING($self->working_dir) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $self->working_dir and not &_STRING(scalar $self->working_dir)
MC/DC0%0/2
defined $self->working_dir and not &_STRING(scalar $self->working_dir)
defined $self->working_dir
not &_STRING(scalar $self->working_dir)
Truth table66%2/3
A and not(B)
A= defined $self->working_dirB= not &_STRING(scalar $self->working_dir)
| |||||||||||||||||||||||||||||
| 38 | 0 | croak("Invalid working_dir param"); | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 2 | return $self; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | ##################################################################### | ||||||||||||||||||||||||||||
| 49 | # Main Methods | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 2 | ▶ | sub as_string { | ||||||||||||||||||||||||||
|
Subroutine
as_string: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 52 | 2 | my $self = shift; | |||||||||||||||||||||||||||
| 53 | 2 | ▶ | return join( '; ', | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | "Name: \"" . $self->name . "\"", | ||||||||||||||||||||||||||||
| 55 | "Filename: \"" . $self->filename . "\"", | ||||||||||||||||||||||||||||
| 56 | defined($self->working_dir) | ||||||||||||||||||||||||||||
| 57 | ? ("WorkingDir: \"" . $self->working_dir . "\"") | ||||||||||||||||||||||||||||
| 58 | : (), | ||||||||||||||||||||||||||||
| 59 | ); | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 2 | 1; | |||||||||||||||||||||||||||