line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
69891
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
193
|
|
4
|
6
|
|
|
6
|
|
19
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
131
|
|
5
|
6
|
|
|
6
|
|
19
|
use Carp; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
367
|
|
6
|
6
|
|
|
6
|
|
1612
|
use Module::New::Loader; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
1280
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $CONTEXT; |
11
|
|
|
|
|
|
|
|
12
|
14
|
|
|
14
|
1
|
109
|
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
|
41430
|
my ($class, @bases) = @_; |
17
|
|
|
|
|
|
|
|
18
|
14
|
|
|
|
|
115
|
my $loader = Module::New::Loader->new( @bases ); |
19
|
|
|
|
|
|
|
|
20
|
14
|
|
|
|
|
80
|
$CONTEXT = $loader->load( 'Context', undef, @bases ); |
21
|
14
|
|
|
|
|
503
|
$CONTEXT->config->get_options( $class->options ); |
22
|
14
|
|
|
|
|
133
|
$CONTEXT; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
524
|
50
|
|
524
|
1
|
3778
|
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__ |