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