line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::New::Command::Readme;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
12
|
use warnings;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
16
|
|
5
|
1
|
|
|
1
|
|
3
|
use Carp;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
3
|
use Module::New::Meta;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
650
|
use Module::New::Queue;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
115
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
functions {
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
create_readme_from_pod => sub () { Module::New::Queue->register(sub {
|
12
|
0
|
|
|
0
|
|
|
my ($self, $file) = @_;
|
13
|
0
|
0
|
0
|
|
|
|
croak "source file is required" unless $file && -f $file;
|
14
|
0
|
|
|
|
|
|
my $context = Module::New->context;
|
15
|
0
|
|
|
|
|
|
my $readme = $context->path->file('README');
|
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
require Pod::Text;
|
18
|
0
|
|
|
|
|
|
my $parser = Pod::Text->new(width => 68, indent => 2);
|
19
|
0
|
|
|
|
|
|
$parser->output_string(\my $pod);
|
20
|
0
|
|
|
|
|
|
$parser->parse_file($file);
|
21
|
0
|
|
|
|
|
|
$readme->spew($pod);
|
22
|
0
|
|
|
|
|
|
$context->log( info => "created README" );
|
23
|
0
|
|
|
0
|
|
|
})},
|
24
|
|
|
|
|
|
|
};
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1;
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__
|