line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Statocles::Base; |
2
|
|
|
|
|
|
|
our $VERSION = '0.086'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Base module for Statocles modules |
4
|
|
|
|
|
|
|
|
5
|
68
|
|
|
68
|
|
440
|
use strict; |
|
68
|
|
|
|
|
164
|
|
|
68
|
|
|
|
|
1824
|
|
6
|
68
|
|
|
68
|
|
327
|
use warnings; |
|
68
|
|
|
|
|
129
|
|
|
68
|
|
|
|
|
1728
|
|
7
|
68
|
|
|
68
|
|
327
|
use base 'Import::Base'; |
|
68
|
|
|
|
|
134
|
|
|
68
|
|
|
|
|
19080
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @IMPORT_MODULES = ( |
10
|
|
|
|
|
|
|
sub { |
11
|
|
|
|
|
|
|
# Disable spurious warnings on platforms that Net::DNS::Native does not |
12
|
|
|
|
|
|
|
# support. We don't use this much mojo |
13
|
|
|
|
|
|
|
$ENV{MOJO_NO_NDN} = 1; |
14
|
|
|
|
|
|
|
return; |
15
|
|
|
|
|
|
|
}, |
16
|
|
|
|
|
|
|
strict => [], |
17
|
|
|
|
|
|
|
warnings => [], |
18
|
|
|
|
|
|
|
feature => [qw( :5.10 )], |
19
|
|
|
|
|
|
|
'Path::Tiny' => [qw( rootdir cwd )], |
20
|
|
|
|
|
|
|
'DateTime::Moonpig', |
21
|
|
|
|
|
|
|
'Statocles', |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my @class_modules = ( |
25
|
|
|
|
|
|
|
'Types::Standard' => [qw( :all )], |
26
|
|
|
|
|
|
|
'Types::Path::Tiny' => [qw( Path AbsPath Dir )], |
27
|
|
|
|
|
|
|
'Statocles::Types' => [qw( :all )], |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our %IMPORT_BUNDLES = ( |
31
|
|
|
|
|
|
|
Test => [ |
32
|
|
|
|
|
|
|
sub { warn 'Bundle Test deprecated and will be removed in v1.000, do not use'; return }, |
33
|
|
|
|
|
|
|
qw( Test::More Test::Deep Test::Differences Test::Exception ), |
34
|
|
|
|
|
|
|
'Dir::Self' => [qw( __DIR__ )], |
35
|
|
|
|
|
|
|
'Path::Tiny' => [qw( path tempdir cwd )], |
36
|
|
|
|
|
|
|
'Statocles::Test' => [qw( |
37
|
|
|
|
|
|
|
test_constructor test_pages build_test_site build_test_site_apps |
38
|
|
|
|
|
|
|
build_temp_site |
39
|
|
|
|
|
|
|
)], |
40
|
|
|
|
|
|
|
'Statocles::Types' => [qw( DateTimeObj )], |
41
|
|
|
|
|
|
|
sub { $Statocles::VERSION ||= 0.001; return }, # Set version normally done via dzil |
42
|
|
|
|
|
|
|
], |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Class => [ |
45
|
|
|
|
|
|
|
'<Moo', |
46
|
|
|
|
|
|
|
@class_modules, |
47
|
|
|
|
|
|
|
], |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Role => [ |
50
|
|
|
|
|
|
|
'<Moo::Role', |
51
|
|
|
|
|
|
|
@class_modules, |
52
|
|
|
|
|
|
|
], |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Emitter => [ |
55
|
|
|
|
|
|
|
'Beam::Emitter', |
56
|
|
|
|
|
|
|
'Statocles::Event', |
57
|
|
|
|
|
|
|
sub { |
58
|
|
|
|
|
|
|
my ( $bundles, $args ) = @_; |
59
|
|
|
|
|
|
|
Moo::Role->apply_roles_to_package( $args->{package}, 'Beam::Emitter' ); |
60
|
|
|
|
|
|
|
return; |
61
|
|
|
|
|
|
|
}, |
62
|
|
|
|
|
|
|
], |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=pod |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=encoding UTF-8 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 NAME |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Statocles::Base - Base module for Statocles modules |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 VERSION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
version 0.086 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 SYNOPSIS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
package MyModule; |
84
|
|
|
|
|
|
|
use Statocles::Base; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
use Statocles::Base 'Class'; |
87
|
|
|
|
|
|
|
use Statocles::Base 'Role'; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 DESCRIPTION |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This is the base module that all Statocles modules should use. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 MODULES |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This module always imports the following into your namespace: |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=over |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item L<Statocles> |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
The base module is imported to make sure that L<File::Share> can find the right |
102
|
|
|
|
|
|
|
share directory. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item L<strict> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item L<warnings> |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item L<feature> |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Currently the 5.10 feature bundle |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item L<Path::Tiny> qw( path rootdir ) |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
We do a lot of work with the filesystem. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item L<DateTime::Moonpig> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=back |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 BUNDLES |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
The following bundles are available. You may import one or more of these by name. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head2 Class |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
The class bundle makes your package into a class and includes: |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=over 4 |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item L<Moo> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item L<Types::Standard> ':all' |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=item L<Types::Path::Tiny> ':all' |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item L<Statocles::Types> ':all' |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=back |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head2 Role |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
The role bundle makes your package into a role and includes: |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=over 4 |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item L<Moo::Role> |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item L<Types::Standard> ':all' |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=item L<Types::Path::Tiny> ':all' |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item L<Statocles::Types> ':all' |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=back |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 SEE ALSO |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=over |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item L<Import::Base> |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=back |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head1 AUTHOR |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Doug Bell <preaction@cpan.org> |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
This software is copyright (c) 2016 by Doug Bell. |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
173
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=cut |