Author: joes
Date: Tue Mar 25 22:15:21 2014
New Revision: 1581560

URL: http://svn.apache.org/r1581560
Log:
quick_deps

Modified:
    thrift/cms-site/trunk/lib/path.pm
    thrift/cms-site/trunk/lib/view.pm

Modified: thrift/cms-site/trunk/lib/path.pm
URL: 
http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/path.pm?rev=1581560&r1=1581559&r2=1581560&view=diff
==============================================================================
--- thrift/cms-site/trunk/lib/path.pm (original)
+++ thrift/cms-site/trunk/lib/path.pm Tue Mar 25 22:15:21 2014
@@ -17,6 +17,7 @@ my %thrift_args = (
     repo          => 'thrift.git',          # set snippet default git repo
     template      => 'default.html',        # set common template argument 
(mainly for .md files)
     snippet_footer=> $thrift_snippet_footer,# append this string to each 
generated snipppet block
+    quick_deps    => 1,                     # short-circuit deps processing to 
simplest case
 );
 
 my $thrift_page_footer = $thrift_snippet_footer;
@@ -25,8 +26,7 @@ $thrift_page_footer =~ s/ snippet / page
 # order matters here: first match wins...  see 
http://www.apache.org/dev/cmsref#core-logic
 
 our @patterns = (
-    [qr!^/sitemap\.html$!,     offline => { %thrift_args, # %thrift_args as 
overrideable defaults
-        view      => 'sitemap',
+    [qr!^/sitemap\.html$!,     sitemap => { %thrift_args, # %thrift_args as 
overrideable defaults
         headers   => { title => "Sitemap" },
         nest      => 1,
     }],
@@ -34,8 +34,7 @@ our @patterns = (
         view      => 'news_page',
         headers   => { title => "Home" },
     }],
-    [qr!/index\.html$!,        offline => { %thrift_args,
-        view      => 'sitemap',
+    [qr!/index\.html$!,        sitemap => { %thrift_args,
         headers   => { title => "Index" }, # "Index" is magical with the 
sitemap view
     }],
     [qr!^/test/!,              snippet => { %thrift_args,

Modified: thrift/cms-site/trunk/lib/view.pm
URL: 
http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/view.pm?rev=1581560&r1=1581559&r2=1581560&view=diff
==============================================================================
--- thrift/cms-site/trunk/lib/view.pm (original)
+++ thrift/cms-site/trunk/lib/view.pm Tue Mar 25 22:15:21 2014
@@ -2,27 +2,5 @@ package view;
 
 # see https://svn.apache.org/repos/infra/websites/cms/build/lib/ASF/View.pm
 use base 'ASF::View';
-use ASF::Util qw/read_text_file parse_filename/;
-use strict;
-use warnings;
-
-# for the speed freak in you- short-circuit view generation for deps with a 
simple read_text_file
-
-sub fetch_deps {
-    my ($path, $data) = @_;
-    for (@{$path::dependencies{$path}}) {
-        my $file = $_;
-        my ($filename, $dirname) = parse_filename;
-        $file = $filename eq "index" ? $dirname : "$dirname$filename.html";
-        for my $p (@path::patterns) {
-            my ($re, $method, $args) = @$p;
-            next unless $_ =~ $re;
-            $data->{$file} = { path => $file, %$args };
-            read_text_file "content$_", $data->{$file};
-            last;
-        }
-        $data->{$file}->{headers}->{title} //= ucfirst $filename;
-    }
-}
 
 1;


Reply via email to