added the other example to synopsis.t
[catagits/HTML-Zoom.git] / maint / synopsis-extractor
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings FATAL => 'all';
5
6 my $from = do { local (@ARGV, $/) = ('lib/HTML/Zoom.pm'); <> };
7
8 $from =~ s/.*^=head1 SYNOPSIS\n//sm;
9
10 $from =~ s/^=head1.*\ncleanly:\n//sm;
11
12 $from =~ s/^This is, admittedly, very much not shorter\..*//sm;
13
14 my $code = join "\n", map { s/^  // ? ($_) : () } split "\n", $from;
15
16 open my $syn_test, '>', 't/synopsis.t'
17   or die "Couldn't open t/synopsis.t - you screwed something up. Go fix it.\n";
18
19 print $syn_test "use strict;
20 use warnings FATAL => 'all';
21 use Test::More qw(no_plan);
22
23 $code;
24 ";