Permalink
Browse files

Made ToHTML/ToLaTeX apps process files in order.

This also changes the ppdom2* wrapper scripts.
  • Loading branch information...
1 parent bc3e7f1 commit 3603e609f2dbc0e030dccc2ee3a12f3285329c9a @chromatic committed Mar 15, 2012
Showing with 14 additions and 14 deletions.
  1. +4 −4 bin/ppdom2html
  2. +4 −4 bin/ppdom2latex
  3. +3 −3 lib/Pod/PseudoPod/DOM/App/ToHTML.pm
  4. +3 −3 lib/Pod/PseudoPod/DOM/App/ToLaTeX.pm
View
@@ -7,16 +7,16 @@ use open qw( :encoding(UTF-8) :std );
use File::Basename;
use Pod::PseudoPod::DOM::App::ToHTML;
-my %files = map
+my @files = map
{
- my $file = $_;
+ my $file = $_;
# HTML output goes to the current working
# directory not the source directory.
my $outfile = fileparse( $file, qr{\..*} ) . '.html';
- $file => $outfile,
+ [ $file => $outfile ],
} @ARGV;
-Pod::PseudoPod::DOM::App::ToHTML::process_files_with_output( %files );
+Pod::PseudoPod::DOM::App::ToHTML::process_files_with_output( @files );
exit;
View
@@ -7,17 +7,17 @@ use Pod::PseudoPod::DOM;
use Pod::PseudoPod::DOM::App::ToLateX;
use File::Basename;
-my %files = map
+my @files = map
{
- my $file = $_;
+ my $file = $_;
# LaTeX output goes to the current working directory,
# not the source directory.
my $outfile = fileparse( $file, qr{\..*} ) . '.tex';
- $file => $outfile
+ [ $file => $outfile ]
} @ARGV;
-Pod::PseudoPod::DOM::App::ToLaTeX::process_files_with_output( %files );
+Pod::PseudoPod::DOM::App::ToLaTeX::process_files_with_output( @files );
exit;
@@ -12,14 +12,14 @@ use Pod::PseudoPod::DOM::App qw( open_fh );
sub process_files_with_output
{
- my %files = @_;
-
my @docs;
my %anchors;
my $corpus = Pod::PseudoPod::DOM::Corpus->new;
- while (my ($source, $output) = each %files)
+ for my $file (@_)
{
+ my ($source, $output) = @$file;
+
my $parser = Pod::PseudoPod::DOM->new(
formatter_role => 'Pod::PseudoPod::DOM::Role::XHTML',
formatter_args => { add_body_tags => 1, anchors => \%anchors },
@@ -10,10 +10,10 @@ use Pod::PseudoPod::DOM::App qw( open_fh );
sub process_files_with_output
{
- my %files = @_;
-
- while (my ($source, $output) = each %files)
+ for my $file ( @_ )
{
+ my ($source, $output) = @$file;
+
my $parser = Pod::PseudoPod::DOM->new(
formatter_role => 'Pod::PseudoPod::DOM::Role::LaTeX',
filename => $output,

0 comments on commit 3603e60

Please sign in to comment.