| 1 | # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- | ||||||||||||||
| 2 | # vim: ts=4 sts=4 sw=4: | ||||||||||||||
| 3 | package CPAN::Distrostatus; | ||||||||||||||
| 4 | 26 | ▶ | use overload '""' => "as_string", | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 26 | fallback => 1; | |||||||||||||
| 6 | 26 | ▶ | use vars qw($something_has_failed_at); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 26 | ▶ | use vars qw( | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | $VERSION | ||||||||||||||
| 9 | 26 | ); | |||||||||||||
| 10 | 26 | $VERSION = "5.5"; | |||||||||||||
| 11 | |||||||||||||||
| 12 | |||||||||||||||
| 13 | 21 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: called CC=2 SCAR=9.2
Pod
undocumented
| |||||||||||||||
| 14 | 0 | ▶ | my($class,$arg) = @_; | ||||||||||||
|
Subroutine
new: not called CC=2 SCAR=9.2
Pod
undocumented
| |||||||||||||||
| 15 | 0 | my $failed = substr($arg,0,2) eq "NO"; | |||||||||||||
| 16 | 0 | ▶ | if ($failed) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 17 | 0 | $something_has_failed_at = $CPAN::CurrentCommandId; | |||||||||||||
| 18 | } | ||||||||||||||
| 19 | bless { | ||||||||||||||
| 20 | 0 | TEXT => $arg, | |||||||||||||
| 21 | FAILED => $failed, | ||||||||||||||
| 22 | COMMANDID => $CPAN::CurrentCommandId, | ||||||||||||||
| 23 | TIME => time, | ||||||||||||||
| 24 | }, $class; | ||||||||||||||
| 25 | } | ||||||||||||||
| 26 | 0 | ▶ | sub something_has_just_failed () { | ||||||||||||
|
Subroutine
something_has_just_failed: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||
| 27 | 0 | ▶ | defined $something_has_failed_at && | ||||||||||||
|
Subroutine
something_has_just_failed: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 2 branches
| |||||||||||||||
| 28 | $something_has_failed_at == $CPAN::CurrentCommandId; | ||||||||||||||
| 29 | } | ||||||||||||||
| 30 | 0 | ▶ | sub commandid { shift->{COMMANDID} } | ||||||||||||
|
Subroutine
commandid: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 31 | 7 | ▶ | sub failed { shift->{FAILED} } | ||||||||||||
|
Subroutine
failed: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 32 | 16 | ▶ | sub text { | ||||||||||||
|
Subroutine
text: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||||||
| 33 | 16 | my($self,$set) = @_; | |||||||||||||
| 34 | 16 | ▶ | if (defined $set) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 35 | 0 | $self->{TEXT} = $set; | |||||||||||||
| 36 | } | ||||||||||||||
| 37 | 16 | $self->{TEXT}; | |||||||||||||
| 38 | } | ||||||||||||||
| 39 | 16 | ▶ | sub as_string { | ||||||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 40 | 16 | my($self) = @_; | |||||||||||||
| 41 | 16 | $self->text; | |||||||||||||
| 42 | } | ||||||||||||||
| 43 | |||||||||||||||
| 44 | |||||||||||||||
| 45 | 26 | 1; | |||||||||||||