line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New;
|
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
72912
|
use strict;
|
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
191
|
|
4
|
6
|
|
|
6
|
|
25
|
use warnings;
|
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
129
|
|
5
|
6
|
|
|
6
|
|
23
|
use Carp;
|
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
342
|
|
6
|
6
|
|
|
6
|
|
1539
|
use Module::New::Loader;
|
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
1219
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.15';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $CONTEXT;
|
11
|
|
|
|
|
|
|
|
12
|
14
|
|
|
14
|
1
|
86
|
sub options {qw( help|h|? author=s email=s force|f grace subdir|in=s )}
|
13
|
0
|
|
|
0
|
1
|
0
|
sub default { 'help' }
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub setup {
|
16
|
14
|
|
|
14
|
1
|
33615
|
my ($class, @bases) = @_;
|
17
|
|
|
|
|
|
|
|
18
|
14
|
|
|
|
|
96
|
my $loader = Module::New::Loader->new( @bases );
|
19
|
|
|
|
|
|
|
|
20
|
14
|
|
|
|
|
60
|
$CONTEXT = $loader->load( 'Context', undef, @bases );
|
21
|
14
|
|
|
|
|
367
|
$CONTEXT->config->get_options( $class->options );
|
22
|
14
|
|
|
|
|
102
|
$CONTEXT;
|
23
|
|
|
|
|
|
|
}
|
24
|
|
|
|
|
|
|
|
25
|
524
|
50
|
|
524
|
1
|
3365
|
sub context { $CONTEXT ? $CONTEXT : shift->setup }
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub dispatch {
|
28
|
0
|
|
|
0
|
1
|
|
my ($class, @bases) = @_;
|
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$class->setup(@bases);
|
31
|
|
|
|
|
|
|
|
32
|
0
|
|
0
|
|
|
|
my $name = shift @ARGV || $class->default;
|
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
unshift @ARGV, $name if $CONTEXT->config('help');
|
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $recipe = $CONTEXT->loader->load_class( Recipe => $name );
|
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
$CONTEXT->config->get_options( $recipe->options );
|
39
|
|
|
|
|
|
|
|
40
|
0
|
0
|
|
|
|
|
croak "author is required" unless $CONTEXT->config('author');
|
41
|
0
|
0
|
|
|
|
|
croak "email is required" unless $CONTEXT->config('email');
|
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
$recipe->run( @ARGV );
|
44
|
|
|
|
|
|
|
}
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1;
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__
|