[Rt-commit] rt branch, squish-refactor, updated. rt-3.9.7-890-gaa26405

Thomas Sibley trs at bestpractical.com
Mon Dec 20 12:13:54 EST 2010


The branch, squish-refactor has been updated
       via  aa26405f0de61ac2160114fe2eea1972c9e7322d (commit)
       via  1ca17a66423132b7cba61b741b7be89fb32d8e8f (commit)
       via  800fbe0813e1b583d73b6170228baf3cd4632aa5 (commit)
      from  41bcc7baf5319981676f323dc563a463c5030e6e (commit)

Summary of changes:
 share/html/Elements/HeaderJavascript |    2 +-
 share/html/NoAuth/css/dhandler       |    2 +-
 share/html/NoAuth/js/dhandler        |    2 +-
 t/web/squish.t                       |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 800fbe0813e1b583d73b6170228baf3cd4632aa5
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 20 11:29:25 2010 -0500

    Simplify the squished CSS filename regex

diff --git a/share/html/NoAuth/css/dhandler b/share/html/NoAuth/css/dhandler
index c3a885c..af81080 100644
--- a/share/html/NoAuth/css/dhandler
+++ b/share/html/NoAuth/css/dhandler
@@ -50,7 +50,7 @@ my $squisher;
 </%ONCE>
 <%INIT>
 my $arg = $m->dhandler_arg;
-if ( $arg =~ m{(.*)/main-squished-(?:[0-9a-f]{32})\.css$} ) {
+if ( $arg =~ m{(.*)/main-squished-[0-9a-f]{32}\.css$} ) {
     my $name = $1;
     my $squished = RT::Interface::Web::SquishedCSS( Name => $name );
     # Don't send Last-Modified since we don't handle If-Modified-Since

commit 1ca17a66423132b7cba61b741b7be89fb32d8e8f
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 20 11:29:53 2010 -0500

    Simplify the squished JS filename regex
    
    Also only match on a-f rather than a-z since it's a hex md5.

diff --git a/share/html/NoAuth/js/dhandler b/share/html/NoAuth/js/dhandler
index 884d1f9..6e2a88e 100644
--- a/share/html/NoAuth/js/dhandler
+++ b/share/html/NoAuth/js/dhandler
@@ -51,7 +51,7 @@ my $content = '';
 
 <%INIT>
 my $arg = $m->dhandler_arg;
-if ( $arg =~ m{squished-(.+)-([a-z0-9]{32})\.js$} ) {
+if ( $arg =~ m{squished-(.+)-[a-f0-9]{32}\.js$} ) {
     my $name = $1;
     my $squished = RT::Interface::Web::SquishedJS( Name => $name );
 

commit aa26405f0de61ac2160114fe2eea1972c9e7322d
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Dec 20 11:36:33 2010 -0500

    Flip two fields in the squished JS filename for consistency with the CSS filename

diff --git a/share/html/Elements/HeaderJavascript b/share/html/Elements/HeaderJavascript
index 34c4538..2734f0e 100644
--- a/share/html/Elements/HeaderJavascript
+++ b/share/html/Elements/HeaderJavascript
@@ -81,7 +81,7 @@ my $js_path;
 if ( !RT->Config->Get('DevelMode') ) {
     my $name = 'head';
     my $key = RT::Interface::Web::SquishedJS( Name => $name )->Key;
-    $js_path = "squished-$name-$key.js";
+    $js_path = "$name-squished-$key.js";
 }
 
 </%INIT>
diff --git a/share/html/NoAuth/js/dhandler b/share/html/NoAuth/js/dhandler
index 6e2a88e..b83786c 100644
--- a/share/html/NoAuth/js/dhandler
+++ b/share/html/NoAuth/js/dhandler
@@ -51,7 +51,7 @@ my $content = '';
 
 <%INIT>
 my $arg = $m->dhandler_arg;
-if ( $arg =~ m{squished-(.+)-[a-f0-9]{32}\.js$} ) {
+if ( $arg =~ m{(.+?)-squished-[a-f0-9]{32}\.js$} ) {
     my $name = $1;
     my $squished = RT::Interface::Web::SquishedJS( Name => $name );
 
diff --git a/t/web/squish.t b/t/web/squish.t
index 82c7a7b..8de1c69 100644
--- a/t/web/squish.t
+++ b/t/web/squish.t
@@ -21,7 +21,7 @@ diag "test squished files with devel mode disabled";
 
     $m->back;
     my ($js_link) =
-      $m->content =~ m!src="([^"]+squished-([^"]+)-([a-f0-9]{32})\.js)"!;
+      $m->content =~ m!src="([^"]+?-squished-([a-f0-9]{32})\.js)"!;
     $m->get_ok( $url . $js_link, 'follow squished js' );
     $m->content_lacks( 'IE7=', 'no IE7.js by default' );
 
@@ -48,7 +48,7 @@ SKIP:
 
     $m->back;
     my ($js_link) =
-      $m->content =~ m!src="([^"]+squished-([^"]+)-([a-f0-9]{32})\.js)"!;
+      $m->content =~ m!src="([^"]+?-squished-([a-f0-9]{32})\.js)"!;
     $m->get_ok( $url . $js_link, 'follow squished js' );
     $m->content_contains( 'IE7=', 'has IE7.js' );
     RT::Test->stop_server;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list