Commit | Line | Data |
d62bc8fd |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use lib 'inc'; |
7 | use File::Find::Rule; |
8 | use Getopt::Long; |
9 | use MyInline; |
10 | use Test::Inline; |
11 | |
12 | my $quiet; |
13 | GetOptions( 'quiet' => \$quiet ); |
14 | |
15 | my $inline = Test::Inline->new( |
16 | verbose => !$quiet, |
17 | ExtractHandler => 'My::Extract', |
18 | ContentHandler => 'My::Content', |
19 | OutputHandler => 'My::Output', |
20 | ); |
21 | |
22 | for my $pod ( |
23 | File::Find::Rule->file->name(qr/\.pod$/)->in('lib/Moose/Cookbook') ) { |
24 | $inline->add($pod); |
25 | } |
26 | |
27 | $inline->save; |
28 | |
29 | { |
30 | |
31 | package My::Output; |
32 | |
33 | use File::Slurp qw( write_file ); |
34 | |
35 | sub write { |
36 | my $class = shift; |
37 | my $name = shift; |
38 | my $content = shift; |
39 | |
40 | $name =~ s/^moose_cookbook_//; |
41 | |
829433c4 |
42 | write_file( "t/recipes/$name", $content ); |
d62bc8fd |
43 | |
44 | return 1; |
45 | } |
46 | } |