Make Gruntmaster::Page::Base::variants not need overriding
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 22 Feb 2014 10:29:53 +0000 (12:29 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 22 Feb 2014 10:30:22 +0000 (12:30 +0200)
lib/Gruntmaster/Page/Base.pm
lib/Gruntmaster/Page/CSS.pm
lib/Gruntmaster/Page/JS.pm
lib/Gruntmaster/Page/Passwd.pm
lib/Gruntmaster/Page/Register.pm
lib/Gruntmaster/Page/Src.pm
lib/Gruntmaster/Page/Submit.pm

index 6ced6145a68eff7367d87293f4963258fa861985..475be80d6952521e4d0fc96c6c82881913b64764 100644 (file)
@@ -92,6 +92,7 @@ sub vary { '' }
 sub max_age { 60 }
 
 sub variants {
+       return [] unless exists $templates{$_[0]};
        [ map { [ $_, 1, 'text/html', undef, undef, $_, undef ]} keys $templates{$_[0]} ]
 }
 
index 2553ab6e5c0833f9371850f83a39d59031b5f65c..7165c3adefc8d4bef306b60fd4ba4615c55ca063 100644 (file)
@@ -19,6 +19,4 @@ sub generate{
        [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800', 'X-Forever' => 1], [minify $css] ]
 }
 
-sub variants{ [[css => 1, 'text/css', undef, undef, undef, undef]] }
-
 1
index b8ddafba37e714c23349ca4f24fb494c96fd52cc..fbaf3daaa163186ae1544a1b4139357a7d0d14d4 100644 (file)
@@ -18,6 +18,4 @@ sub generate{
        [200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'public, max-age=604800', 'X-Forever' => 1], [minify $js] ]
 }
 
-sub variants{ [[js => 1, 'application/javascript', undef, undef, undef, undef]] }
-
 1
index 86689ac04be0621a93bc59083e5e1f36d399a865..73b768026d8f3dcbcca9aaae8d1aed4286a3c599 100644 (file)
@@ -22,6 +22,4 @@ sub generate{
        reply 'Password changed successfully';
 }
 
-sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] }
-
 1
index dcb9451ebd8c40b682372e728796a047fb58c9e0..5a3edd161a7184a9f666ce6e95cc78d836ef9bb6 100644 (file)
@@ -27,6 +27,4 @@ sub generate{
        reply 'Registered successfully';
 }
 
-sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] }
-
 1
index 8e51d8ba71b676455badcb638a57a5ee1d7f6407..6dd5a9c2ad29dc5201a89786628ce2488fa5500b 100644 (file)
@@ -25,6 +25,4 @@ sub generate{
        [200, ['Content-Type' => CONTENT_TYPES->{$ext}, 'Cache-Control' => 'max-age=604800', 'X-Forever' => 1], [job_inmeta($job)->{files}{prog}{content}] ]
 }
 
-sub variants{ [[file => 1, undef, undef, undef, undef, undef]] }
-
 1
index 0159a9d06865f7a3f1132324e171bf310a4c748a..2c9fef0c526cb8d869fd698bd4edbcc9e0abb42e 100644 (file)
@@ -61,6 +61,4 @@ sub generate{
        [303, [Location => $r->path =~ s,/pb/\w+/submit$,/log/,r], ['']]
 }
 
-sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] }
-
 1
This page took 0.01574 seconds and 4 git commands to generate.