line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
43141
|
use 5.006; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
241
|
|
2
|
7
|
|
|
7
|
|
27
|
use strict; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
191
|
|
3
|
7
|
|
|
7
|
|
26
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
442
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dist::Zilla::dumpphases::Role::Theme::SimpleColor; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.000007'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: A role for themes that are simple single-color themes with variations of bold/uncolored. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
7
|
|
|
7
|
|
631
|
use Role::Tiny qw( requires with ); |
|
7
|
|
|
|
|
3764
|
|
|
7
|
|
|
|
|
43
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
with 'Dist::Zilla::dumpphases::Role::Theme'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
requires 'color'; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
## no critic ( RequireArgUnpacking ) |
38
|
|
|
|
|
|
|
sub _colored { |
39
|
0
|
|
|
0
|
|
|
require Term::ANSIColor; |
40
|
0
|
|
|
|
|
|
goto \&Term::ANSIColor::colored; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _color_label_label { |
44
|
0
|
|
|
0
|
|
|
my $self = shift; |
45
|
0
|
|
|
|
|
|
return _colored( [ $self->color ], @_ ); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _color_label_value { |
49
|
0
|
|
|
0
|
|
|
shift; |
50
|
0
|
|
|
|
|
|
return _colored( ['bold'], @_ ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _color_attribute_label { |
54
|
0
|
|
|
0
|
|
|
my $self = shift; |
55
|
0
|
|
|
|
|
|
return _colored( [ $self->color, 'bold' ], @_ ); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _color_attribute_value { |
59
|
0
|
|
|
0
|
|
|
my $self = shift; |
60
|
0
|
|
|
|
|
|
return _colored( [ $self->color ], @_ ); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _color_plugin_name { |
64
|
0
|
|
|
0
|
|
|
shift; |
65
|
0
|
|
|
|
|
|
return @_; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub _color_plugin_package { |
69
|
0
|
|
|
0
|
|
|
my $self = shift; |
70
|
0
|
|
|
|
|
|
return _colored( [ $self->color ], @_ ); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub _color_plugin_star { |
74
|
0
|
|
|
0
|
|
|
my $self = shift; |
75
|
0
|
|
|
|
|
|
return _colored( [ $self->color ], @_ ); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub print_section_header { |
87
|
0
|
|
|
0
|
|
|
my ( $self, $label, $comment ) = @_; |
88
|
0
|
|
|
|
|
|
return printf "\n%s%s\n", $self->_color_label_label($label), $self->_color_label_value($comment); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub print_section_prelude { |
100
|
0
|
|
|
0
|
|
|
my ( $self, $label, $value ) = @_; |
101
|
0
|
|
|
|
|
|
return printf "%s%s\n", $self->_color_attribute_label( ' - ' . $label ), $self->_color_attribute_value($value); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub print_star_assoc { |
113
|
0
|
|
|
0
|
|
|
my ( $self, $name, $value ) = @_; |
114
|
0
|
|
|
|
|
|
return printf "%s%s%s\n", |
115
|
|
|
|
|
|
|
$self->_color_plugin_star(' * '), |
116
|
|
|
|
|
|
|
$self->_color_plugin_name($name), |
117
|
|
|
|
|
|
|
$self->_color_plugin_package( ' => ' . $value ); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
1; |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
__END__ |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=pod |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=encoding UTF-8 |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 NAME |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Dist::Zilla::dumpphases::Role::Theme::SimpleColor - A role for themes that are simple single-color themes with variations of bold/uncolored. |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=head1 VERSION |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
version 1.000007 |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 SYNOPSIS |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
package Dist::Zilla::dumpphases::Theme::foo; |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
use Moo; |
155
|
|
|
|
|
|
|
with 'Dist::Zilla::dumpphases::Role::Theme::SimpleColor'; |
156
|
|
|
|
|
|
|
sub color { 'magenta' }; |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
... |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
dzil dumpphases --color-theme=foo |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=begin MetaPOD::JSON v1.1.0 |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
{ |
165
|
|
|
|
|
|
|
"namespace":"Dist::Zilla::dumpphases::Role::Theme::SimpleColor", |
166
|
|
|
|
|
|
|
"does":"Dist::Zilla::dumpphases::Role::Theme", |
167
|
|
|
|
|
|
|
"interface":"role" |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=end MetaPOD::JSON |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head1 REQUIRED METHODS |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head2 C<color> |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
You must define a method called C<color> that returns a string (or list of strings ) that C<Term::ANSIColor> recognizes. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head1 METHODS |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head2 C<print_section_header> |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
See L<Dist::Zilla::dumpphases::Role::Theme/print_section_header>. |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
This satisfies that, printing label colored, and the value uncolored. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=head2 C<print_section_prelude> |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
See L<Dist::Zilla::dumpphases::Role::Theme/print_section_prelude>. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
This satisfies that, printing label bold and colored, and the value simply colored. |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head2 C<print_star_assoc> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
See L<Dist::Zilla::dumpphases::Role::Theme/print_star_assoc>. |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
This satisfies that, printing label uncolored, and the value simply colored. |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head1 AUTHOR |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Kent Fredric <kentnl@cpan.org>. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
208
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=cut |