| 1 | #!/usr/local/bin/perl |
| 2 | |
| 3 | # Original authors: don |
| 4 | # $Revision: $ |
| 5 | |
| 6 | |
| 7 | use strictscip-perl cpan Pod-POM-View-Restructured 1.000004 strict/; |
| 8 | use warningsscip-perl cpan Pod-POM-View-Restructured 1.000004 warnings/; |
| 9 | use Carpscip-perl cpan Pod-POM-View-Restructured 1.000004 Carp/; |
| 10 | use Getopt::Longscip-perl cpan Pod-POM-View-Restructured 1.000004 Getopt/Long/ qw(:config no_ignore_case bundling); |
| 11 | use Pod::POMscip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/; |
| 12 | |
| 13 | # main |
| 14 | { |
| 15 | # local($SIG{__DIE__}) = sub { &Carp::confess }; |
| 16 | my $self = blessscip-perl cpan Pod-POM-View-Restructured 1.000004 main/bless(). { }; |
| 17 | |
| 18 | my $top_dir; |
| 19 | # Set up @INC to get right version of module |
| 20 | use File::Specscip-perl cpan Pod-POM-View-Restructured 1.000004 File/Spec/ (); |
| 21 | BEGIN { |
| 22 | my $path = File::Spec->rel2absscip-perl cpan Pod-POM-View-Restructured 1.000004 File/Spec/rel2abs().($0scip-perl cpan Pod-POM-View-Restructured 1.000004 main/$0.); |
| 23 | (my $dir = $path) =~ s{(?:/[^/]+){2}\Z}{}; |
| 24 | # unshift @INC, $dir . "/blib/lib", $dir . "/blib/arch"; |
| 25 | unshiftscip-perl cpan Pod-POM-View-Restructured 1.000004 main/unshift(). @INCscip-perl cpan Pod-POM-View-Restructured 1.000004 main/`@INC`., $dir . "/lib"; |
| 26 | |
| 27 | $top_dir = $dir; |
| 28 | } |
| 29 | |
| 30 | my $test_dir = $top_dir . "/test_doc/source"; |
| 31 | |
| 32 | use Pod::POM::View::Restructuredscip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/View/Restructured/; |
| 33 | |
| 34 | my $view = Pod::POM::View::Restructured->newscip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/View/Restructured/new().; |
| 35 | my $parser = Pod::POM->newscip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/new().; |
| 36 | my $pom = $parser->parse_filescip-perl cpan Pod-POM-View-Restructured 1.000004 Pod/POM/parse_file().("$top_dir/lib/Pod/POM/View/Restructured.pm"); |
| 37 | my $out = $pom->presentscip-perl cpan Pod-POM-View-Restructured 1.000004 main/present().($view); |
| 38 | |
| 39 | my $out_file = $test_dir . "/restructured.rst"; |
| 40 | openscip-perl cpan Pod-POM-View-Restructured 1.000004 main/open().(my $out_fh, '>', $out_file) or diescip-perl cpan Pod-POM-View-Restructured 1.000004 main/die(). "couldn't open output file $out_file"; |
| 41 | binmodescip-perl cpan Pod-POM-View-Restructured 1.000004 main/binmode().($out_fh, ':utf8'); |
| 42 | print $out_fh $out; |
| 43 | closescip-perl cpan Pod-POM-View-Restructured 1.000004 main/close(). $out_fh; |
| 44 | |
| 45 | # print "output:\n\n$out\n"; |
| 46 | |
| 47 | } |
| 48 | |
| 49 | exitscip-perl cpan Pod-POM-View-Restructured 1.000004 main/exit(). 0; |
| 50 | |
| 51 | ############################################################################### |
| 52 | # Subroutines |