Add one more deleted recipe to the Legacy section
[gitmo/Moose.git] / author / extract-inline-tests
CommitLineData
d62bc8fd 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use lib 'inc';
7use File::Find::Rule;
8use Getopt::Long;
9use MyInline;
10use Test::Inline;
11
12my $quiet;
13GetOptions( 'quiet' => \$quiet );
14
15my $inline = Test::Inline->new(
16 verbose => !$quiet,
17 ExtractHandler => 'My::Extract',
18 ContentHandler => 'My::Content',
19 OutputHandler => 'My::Output',
20);
21
22for 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}