[Jifty-commit] r4276 - jifty/trunk/lib/Jifty/Plugin

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Oct 20 04:19:40 EDT 2007


Author: clkao
Date: Sat Oct 20 04:19:40 2007
New Revision: 4276

Modified:
   jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm

Log:
simplify ccjs plugin with static handler method call.

Modified: jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm	Sat Oct 20 04:19:40 2007
@@ -111,23 +111,12 @@
         or Jifty->config->framework('DevelMode') ) {
         Jifty->log->debug("Generating JS...");
 
-        my @roots = map { Jifty::Util->absolute_path( File::Spec->catdir( $_, 'js' ) ) }
-                        Jifty->handler->view('Jifty::View::Static::Handler')->roots;
-
+        # for the file cascading logic
+        my $static_handler = Jifty->handler->view('Jifty::View::Static::Handler');
         my $js = "";
 
         for my $file ( @{ Jifty::Web->javascript_libs } ) {
-            my $include;
-
-            for my $root (@roots) {
-                my @spec = File::Spec->splitpath( $root, 1 );
-                my $path = File::Spec->catpath( @spec[ 0, 1 ], $file );
-
-                if ( -e $path ) {
-                    $include = $path;
-                    last;
-                }
-            }
+            my $include = $static_handler->file_path( $file );
 
             if ( defined $include ) {
                 my $fh;


More information about the Jifty-commit mailing list