blib/lib/Check/Term.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 87.5% 14 / 16 CC 1 SCAR 0.7
CC
1
Cov
83%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
↑ Summary
1 package Check::Term;
2  
3 3 ▶use parent qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=2.6
8 use Term::Terminfo;
9  
10 our $ERROR_MESSAGE;
11 Readonly::Array our @EXPORT_OK => qw(check_term_capabilities $ERROR_MESSAGE);
12  
13 our $VERSION = 0.01;
14  
15 sub check_term_capabilities {
16 my @capabilities = @_;
17  
18 my $ti = Term::Terminfo->new;
19 foreach my $capability (@capabilities) {
20 if (! defined $ti->str_by_varname($capability)) {
21 $ERROR_MESSAGE = "Terminal capability '$capability' ins't supported.";
22 return 0;
23 }
24 }
25  
26 return 1;
27 }
28  
29 1;
30  
31 __END__
↑ Summary