line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Base class for interactive interfaces |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Pinto::Chrome; |
4
|
|
|
|
|
|
|
|
5
|
57
|
|
|
57
|
|
30693
|
use Moose; |
|
57
|
|
|
|
|
132
|
|
|
57
|
|
|
|
|
395
|
|
6
|
57
|
|
|
57
|
|
351726
|
use MooseX::StrictConstructor; |
|
57
|
|
|
|
|
161
|
|
|
57
|
|
|
|
|
461
|
|
7
|
57
|
|
|
57
|
|
173700
|
use MooseX::Types::Moose qw(Int Bool); |
|
57
|
|
|
|
|
148
|
|
|
57
|
|
|
|
|
761
|
|
8
|
57
|
|
|
57
|
|
256795
|
use MooseX::MarkAsMethods ( autoclean => 1 ); |
|
57
|
|
|
|
|
135
|
|
|
57
|
|
|
|
|
483
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.13'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has verbose => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => Int, |
19
|
|
|
|
|
|
|
default => 0, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has quiet => ( |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
isa => Bool, |
25
|
|
|
|
|
|
|
default => 0, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
0
|
0
|
sub show { return 1 } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
0
|
0
|
sub diag { return 1 } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
0
|
0
|
sub edit { return $_[1] } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
0
|
0
|
sub show_progress { return 1 } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
0
|
0
|
sub progress_done { return 1 } |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub should_render_diag { |
51
|
530
|
|
|
530
|
0
|
1916
|
my ( $self, $level ) = @_; |
52
|
|
|
|
|
|
|
|
53
|
530
|
100
|
|
|
|
3367
|
return 1 if $level == 0; # Always, always display errors |
54
|
472
|
100
|
|
|
|
12821
|
return 0 if $self->quiet; # Don't display anything else if quiet |
55
|
469
|
100
|
|
|
|
12231
|
return 1 if $self->verbose + 1 >= $level; |
56
|
9
|
|
|
|
|
143
|
return 0; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
60
|
|
|
|
|
|
|
|
61
|
57
|
|
|
57
|
0
|
228
|
sub diag_levels { return qw(error warning notice info) } |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my @levels = __PACKAGE__->diag_levels; |
66
|
|
|
|
|
|
|
__generate_diag_method( $levels[$_], $_ ) for ( 0 .. $#levels ); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub __generate_diag_method { |
71
|
228
|
|
|
228
|
|
543
|
my ( $method_name, $diag_level ) = @_; |
72
|
|
|
|
|
|
|
|
73
|
228
|
|
|
|
|
370
|
my $template = <<'END_METHOD'; |
74
|
|
|
|
|
|
|
sub %s { |
75
|
|
|
|
|
|
|
my ($self, $msg, $opts) = @_; |
76
|
|
|
|
|
|
|
return unless $self->should_render_diag(%s); |
77
|
|
|
|
|
|
|
$self->diag($msg, $opts); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
END_METHOD |
80
|
|
|
|
|
|
|
|
81
|
228
|
50
|
|
55
|
0
|
13295
|
eval sprintf $template, $method_name, $diag_level; |
|
55
|
100
|
|
191
|
0
|
321
|
|
|
55
|
100
|
|
256
|
0
|
487
|
|
|
55
|
50
|
|
16
|
0
|
505
|
|
|
191
|
|
|
|
|
7942
|
|
|
191
|
|
|
|
|
1622
|
|
|
188
|
|
|
|
|
1391
|
|
|
256
|
|
|
|
|
10698
|
|
|
256
|
|
|
|
|
2124
|
|
|
253
|
|
|
|
|
2151
|
|
|
16
|
|
|
|
|
86
|
|
|
16
|
|
|
|
|
115
|
|
|
16
|
|
|
|
|
114
|
|
82
|
228
|
50
|
|
|
|
1242
|
croak $@ if $@; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=pod |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=encoding UTF-8 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=for :stopwords Jeffrey Ryan Thalhammer |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 NAME |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Pinto::Chrome - Base class for interactive interfaces |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head1 VERSION |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
version 0.13 |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 AUTHOR |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@stratopan.com> |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
117
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |