line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dezi::Role; |
2
|
15
|
|
|
15
|
|
12804
|
use Moose::Role; |
|
15
|
|
|
|
|
18470
|
|
|
15
|
|
|
|
|
107
|
|
3
|
15
|
|
|
15
|
|
81961
|
use Dezi::Types qw( DeziLogLevel ); |
|
15
|
|
|
|
|
44
|
|
|
15
|
|
|
|
|
135
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.014'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has 'debug' => ( |
8
|
|
|
|
|
|
|
is => 'rw', |
9
|
|
|
|
|
|
|
isa => DeziLogLevel, |
10
|
|
|
|
|
|
|
lazy => 1, |
11
|
|
|
|
|
|
|
default => sub { $ENV{DEZI_DEBUG} || 0 }, |
12
|
|
|
|
|
|
|
coerce => 1, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
has 'verbose' => ( |
15
|
|
|
|
|
|
|
is => 'rw', |
16
|
|
|
|
|
|
|
isa => DeziLogLevel, |
17
|
|
|
|
|
|
|
lazy => 1, |
18
|
|
|
|
|
|
|
default => sub { $ENV{DEZI_VERBOSE} || 0 }, |
19
|
|
|
|
|
|
|
coerce => 1, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
has 'warnings' => ( |
22
|
|
|
|
|
|
|
is => 'rw', |
23
|
|
|
|
|
|
|
isa => DeziLogLevel, |
24
|
|
|
|
|
|
|
lazy => 1, |
25
|
|
|
|
|
|
|
default => sub { |
26
|
|
|
|
|
|
|
return 1 unless exists $ENV{DEZI_WARNINGS}; |
27
|
|
|
|
|
|
|
$ENV{DEZI_WARNINGS} || 0; |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
coerce => 1, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=pod |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Dezi::Role - common attributes for Dezi classes |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package My::Class; |
41
|
|
|
|
|
|
|
use Moose; |
42
|
|
|
|
|
|
|
with 'Dezi::Role'; |
43
|
|
|
|
|
|
|
# other stuff |
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# see METHODS for what you get for free |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Dezi::Role isa Moose::Role. It creates a few attributes (see L<METHODS>) |
51
|
|
|
|
|
|
|
common to most Dezi classes. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 BUILD |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Initializes new object. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 debug |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Get/set the debug level. Default is C<DEZI_DEBUG> env var or 0. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 warnings |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Get/set the warnings level. Default is C<DEZI_WARNINGS> env var or 1. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 verbose |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Get/set flags affecting the verbosity of the program. Default is C<DEZI_VERBOSE> env var or 0. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub BUILD { |
74
|
1
|
|
|
1
|
1
|
2586
|
my $self = shift; |
75
|
1
|
|
|
|
|
7
|
$self->{_start} = time(); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 elapsed |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Returns the elapsed time in seconds since object was created. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub elapsed { |
85
|
0
|
|
|
0
|
1
|
|
return time() - shift->{_start}; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 AUTHOR |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Peter Karman, E<lt>karpet@dezi.orgE<gt> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 BUGS |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<bug-dezi-app at rt.cpan.org>, or through |
99
|
|
|
|
|
|
|
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dezi-App>. |
100
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 SUPPORT |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
perldoc Dezi::Class |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
You can also look for information at: |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=over 4 |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item * Website |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
L<http://dezi.org/> |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item * IRC |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
#dezisearch at freenode |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * Mailing list |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
L<https://groups.google.com/forum/#!forum/dezi-search> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dezi-App> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
L<http://annocpan.org/dist/Dezi-App> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * CPAN Ratings |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
L<http://cpanratings.perl.org/d/Dezi-App> |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item * Search CPAN |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
L<https://metacpan.org/dist/Dezi-App/> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=back |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Copyright 2014 by Peter Karman |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
147
|
|
|
|
|
|
|
it under the terms of the GPL v2 or later. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 SEE ALSO |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
L<http://dezi.org/>, L<http://swish-e.org/>, L<http://lucy.apache.org/> |
152
|
|
|
|
|
|
|
|