diff options
author | Ricardo Signes <rjbs@cpan.org> | 2012-02-07 07:32:57 -0500 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2012-02-07 07:57:36 -0500 |
commit | b069bc5e4376bcbd50b97f34a027cf3048d3c202 (patch) | |
tree | 0760e938bb42ade7d7698d78eb6406375c2101a3 /ext/Pod-Html | |
parent | b3100a1d0ee80a210e6330922fa4c78edffb7d52 (diff) | |
download | perl-b069bc5e4376bcbd50b97f34a027cf3048d3c202.tar.gz |
avoid making a new top-level package for one helper
Diffstat (limited to 'ext/Pod-Html')
-rw-r--r-- | ext/Pod-Html/lib/Pod/Html.pm | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/ext/Pod-Html/lib/Pod/Html.pm b/ext/Pod-Html/lib/Pod/Html.pm index 3977ded966..9f333bc1de 100644 --- a/ext/Pod-Html/lib/Pod/Html.pm +++ b/ext/Pod-Html/lib/Pod/Html.pm @@ -292,7 +292,7 @@ sub pod2html { # be used throughout. #$Htmlfileurl = "$Htmldir/" . substr( $Htmlfile, length( $Htmldir ) + 1); # Is the above not just "$Htmlfileurl = $Htmlfile"? - $Htmlfileurl = Unixify::unixify($Htmlfile); + $Htmlfileurl = Pod::Html::_unixify($Htmlfile); } @@ -647,13 +647,19 @@ sub _save_page { } # Convert path to unix style path - $modspec = Unixify::unixify($modspec); + $modspec = Pod::Html::_unixify($modspec); my ($file, $dir) = fileparse($modspec, qr/\.[^.]*/); # strip .ext $Pages{$modname} = $dir.$file; } -1; +sub _unixify { + my $full_path = shift; + return '' unless $full_path; + + return File::Spec::Unix->catfile( # change \s to /s and such + File::Spec->splitdir($full_path)); +} package Pod::Simple::XHTML::LocalPodLinks; use strict; @@ -718,14 +724,14 @@ sub resolve_pod_page_link { # The use of catdir here (instead of catfile) ensures there will be one # '/' between htmlroot and $path; not zero (if htmlroot == ''), not two # (if htmlroot =~ m#/\z# and $path =~ m#\a/#), just one. - my $url = File::Spec::Unix->catdir( Unixify::unixify($self->htmlroot), + my $url = File::Spec::Unix->catdir( Pod::Html::_unixify($self->htmlroot), $path); if ($self->htmlfileurl ne '') { # then $self->htmlroot eq '' (by definition of htmlfileurl) so # $self->htmldir needs to be prepended to link to get the absolute path # that will be relativized $url = relativize_url( - File::Spec::Unix->catdir( Unixify::unixify($self->htmldir), $url), + File::Spec::Unix->catdir( Pod::Html::_unixify($self->htmldir), $url), $self->htmlfileurl # already unixified ); } @@ -764,20 +770,3 @@ sub relativize_url { } 1; - -package Unixify; -use warnings; -use strict; - -use File::Spec; -use File::Spec::Unix; - -sub unixify { - my $full_path = shift; - return '' unless $full_path; - - return File::Spec::Unix->catfile( # change \s to /s and such - File::Spec->splitdir($full_path)); -} - -1; |