File Coverage

blib/lib/MaxMind/DB/Role/Debugs.pm
Criterion Covered Total %
statement 15 43 34.8
branch 0 4 0.0
condition n/a
subroutine 5 11 45.4
pod n/a
total 20 58 34.4


line stmt bran cond sub pod time code
1             package MaxMind::DB::Role::Debugs;
2             $MaxMind::DB::Role::Debugs::VERSION = '0.031003';
3 2     2   2932 use strict;
  2         3  
  2         77  
4 2     2   11 use warnings;
  2         4  
  2         63  
5 2     2   9 use namespace::autoclean;
  2         4  
  2         14  
6 2     2   12896 use autodie;
  2         76110  
  2         13  
7              
8 2     2   28235 use Moo::Role;
  2         6  
  2         240  
9              
10             sub _debug_newline {
11 0     0     warn "\n";
12             }
13              
14             sub _debug_binary {
15 0     0     my $self = shift;
16 0           my $label = shift;
17 0           my $binary = shift;
18              
19 0           my $msg = "$label: ";
20              
21 0 0         if ( defined $binary ) {
22 0           $msg .= join q{ }, map { sprintf( "%08b", ord($_) ) } split //,
  0            
23             $binary;
24             }
25             else {
26 0           $msg .= '<undef>';
27             }
28              
29 0           warn "$msg\n";
30             }
31              
32             sub _debug_string {
33 0     0     my $self = shift;
34 0           my $label = shift;
35 0           my $string = shift;
36              
37 0 0         $string = '<undef>'
38             unless defined $string;
39              
40 0           warn "$label: $string\n";
41             }
42              
43             sub _debug_sprintf {
44 0     0     my $self = shift;
45              
46 0           warn sprintf( shift() . "\n", @_ );
47             }
48              
49             sub _debug_structure {
50 0     0     my $self = shift;
51 0           my $label = shift;
52 0           my $structure = shift;
53              
54 0           require Data::Dumper::Concise;
55 0           warn "$label: \n";
56 0           my $dumped = Data::Dumper::Concise::Dumper($structure);
57              
58 0           $dumped =~ s/^/ /mg;
59              
60 0           warn $dumped;
61             }
62              
63             sub _debug_message {
64 0     0     my $self = shift;
65 0           my $msg = shift;
66              
67 0           warn "$msg\n";
68             }
69              
70             1;