You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by st...@apache.org on 2002/06/11 17:02:10 UTC

cvs commit: modperl-docs/lib/DocSet NavigateCache.pm RunTime.pm Util.pm

stas        2002/06/11 08:02:10

  Modified:    lib/DocSet NavigateCache.pm RunTime.pm Util.pm
  Log:
  - must always use '/' when generating URIs, that means that fs paths
    from OS like Win32 cannot be used as is. So we use the OS specific
    splitdir to get rid of the separators and join the dirs with '/'.
  
  Revision  Changes    Path
  1.4       +5 -0      modperl-docs/lib/DocSet/NavigateCache.pm
  
  Index: NavigateCache.pm
  ===================================================================
  RCS file: /home/cvs/modperl-docs/lib/DocSet/NavigateCache.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NavigateCache.pm	29 Apr 2002 17:36:54 -0000	1.3
  +++ NavigateCache.pm	11 Jun 2002 15:02:10 -0000	1.4
  @@ -148,6 +148,11 @@
   }
   
   # get the first child node
  +# note that in order not to break the navigation links, it always
  +# returns a value if there is a child node, no matter if it's hidden
  +# or not. so the check for hidden must be done in the caller's code,
  +# e.g.: $o->down->first - first() will return undef if the first is
  +# hidden.
   sub down {
       my($self) = @_;
   
  
  
  
  1.7       +3 -3      modperl-docs/lib/DocSet/RunTime.pm
  
  Index: RunTime.pm
  ===================================================================
  RCS file: /home/cvs/modperl-docs/lib/DocSet/RunTime.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RunTime.pm	10 Jun 2002 17:57:57 -0000	1.6
  +++ RunTime.pm	11 Jun 2002 15:02:10 -0000	1.7
  @@ -136,7 +136,7 @@
       for my $path (keys %src_docs) {
           if (my $found_path = match_in_doc_src_subset($path,
                                                        $resource_rel_path)) {
  -            return $found_path;
  +            return path2uri($found_path);
           }
       }
   
  @@ -147,7 +147,7 @@
       for my $path (@search_paths) {
           if ($resource_rel_path =~ m|^$path/(.*)|) {
               if (my $found_path = match_in_doc_src_subset($path, $1)) {
  -                return $found_path;
  +                return path2uri($found_path);
               }
           }
       }
  @@ -167,7 +167,7 @@
   #print qq{Try:  $base_path :: $rel_path.$ext\n};
           if (exists $src_docs{$base_path}{"$rel_path.$ext"}) {
   #print qq{Found $base_path/$rel_path.$ext\n};
  -            return join '/', $base_path, "$rel_path.$ext";
  +            return catdir $base_path, "$rel_path.$ext";
           }
       }
       return;
  
  
  
  1.12      +14 -1     modperl-docs/lib/DocSet/Util.pm
  
  Index: Util.pm
  ===================================================================
  RCS file: /home/cvs/modperl-docs/lib/DocSet/Util.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Util.pm	21 Apr 2002 07:25:18 -0000	1.11
  +++ Util.pm	11 Jun 2002 15:02:10 -0000	1.12
  @@ -23,7 +23,7 @@
                create_dir filename filename_ext require_package dumper
                sub_trace note get_date get_timestamp proc_tmpl
                build_matchmany_sub banner confess cluck carp
  -             format_bytes expand_dir which);
  +             format_bytes expand_dir which path2uri);
   
   # copy_file($src_path, $dst_path);
   # copy a file at $src_path to $dst_path, 
  @@ -126,6 +126,16 @@
       $ext;
   }
   
  +
  +# since on non-Unix platforms the fs path's separator don't match the
  +# URI separator ('/'), we need to rewrite those paths
  +# accept a relative native path 
  +# return relative URI
  +sub path2uri {
  +    return unless defined $_[0];
  +    return join '/', File::Spec->splitdir(shift);
  +}
  +
   sub get_date {
       sprintf "%s %d, %d", (split /\s+/, scalar localtime)[1,2,4];
   }
  @@ -318,6 +328,7 @@
     my $ext = filename_ext($filename);
     my $date = get_date();
     my $timestamp = get_timestamp();
  +  my $uri = path2uri($os_path);
   
     require_package($package);
     my $output = proc_tmpl($tmpl_root, $tmpl_file, $mode, $vars);
  @@ -352,6 +363,8 @@
   =item * read_file_paras
   
   =item * filename_ext
  +
  +=item * path2uri
   
   =item * get_date
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org