| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Module::New::Command::Readme; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 5 | use strict; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 36 |  | 
| 4 | 1 |  |  | 1 |  | 6 | use warnings; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 180 |  | 
| 5 | 1 |  |  | 1 |  | 7 | use Carp; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 76 |  | 
| 6 | 1 |  |  | 1 |  | 5 | use Module::New::Meta; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 6 |  | 
| 7 | 1 |  |  | 1 |  | 61 | use Module::New::Queue; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 257 |  | 
| 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__ |