line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New;
|
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
61071
|
use strict;
|
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
177
|
|
4
|
6
|
|
|
6
|
|
26
|
use warnings;
|
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
129
|
|
5
|
6
|
|
|
6
|
|
22
|
use Carp;
|
|
6
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
314
|
|
6
|
6
|
|
|
6
|
|
1375
|
use Module::New::Loader;
|
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
1116
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.14';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $CONTEXT;
|
11
|
|
|
|
|
|
|
|
12
|
14
|
|
|
14
|
1
|
76
|
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
|
33318
|
my ($class, @bases) = @_;
|
17
|
|
|
|
|
|
|
|
18
|
14
|
|
|
|
|
86
|
my $loader = Module::New::Loader->new( @bases );
|
19
|
|
|
|
|
|
|
|
20
|
14
|
|
|
|
|
52
|
$CONTEXT = $loader->load( 'Context', undef, @bases );
|
21
|
14
|
|
|
|
|
354
|
$CONTEXT->config->get_options( $class->options );
|
22
|
14
|
|
|
|
|
86
|
$CONTEXT;
|
23
|
|
|
|
|
|
|
}
|
24
|
|
|
|
|
|
|
|
25
|
524
|
50
|
|
524
|
1
|
3405
|
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__
|