CSE/Colorizer.pm

filter: Statementstmt 92.3% 12 / 13 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 89.4% 17 / 19 CC 2 SCAR 4.5
CC
2
Cov
87%
colored
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« CSE/File/TextXTex.pm ↑ Summary CSE/Command.pm »
1 package App::CSE::Colorizer;
2 11 $App::CSE::Colorizer::VERSION = '0.016';
3 11 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 11 has 'cse' => ( is => 'ro' , isa => 'App::CSE', required => 1);
6  
7 11 ▶use Term::ANSIColor qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head2 colored
10  
11 Returns a colored text only in an interactive environment.
12  
13 =cut
14  
15 1 ▶sub colored{
Subroutine colored: called CC=2 SCAR=7.6
Pod documented
16 1 my ($self, $text, $ansi_color_def) = @_;
17 1 ▶ if( $self->cse->interactive() ){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->cse->interactive) 0 1 1
18 0 return Term::ANSIColor::colored($text, $ansi_color_def);
19 }
20 1 return $text;
21 }
22  
23 11 __PACKAGE__->meta->make_immutable();
« CSE/File/TextXTex.pm ↑ Summary CSE/Command.pm »