[Rt-commit] rt branch, squish-refactor, updated. rt-3.9.7-892-ga5e4e38

? sunnavy sunnavy at bestpractical.com
Thu Dec 23 00:48:10 EST 2010


The branch, squish-refactor has been updated
       via  a5e4e3867164e0d7e38a4bbc824987a4ce981de0 (commit)
       via  78cde82a53774bfdec5c84bbeba0895e915ec269 (commit)
      from  aa26405f0de61ac2160114fe2eea1972c9e7322d (commit)

Summary of changes:
 lib/RT/Interface/Web.pm              |   14 ++++++--------
 share/html/Elements/Header           |    4 ++--
 share/html/Elements/HeaderJavascript |    2 +-
 share/html/NoAuth/css/dhandler       |    4 ++--
 share/html/NoAuth/js/dhandler        |    2 +-
 t/web/squish.t                       |    4 ++--
 6 files changed, 14 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit 78cde82a53774bfdec5c84bbeba0895e915ec269
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 23 13:33:56 2010 +0800

    tweak squished css file name to be consistent with squished js names

diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index c7fdf30..196c82d 100755
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -111,7 +111,7 @@ if ( RT->Config->Get('DevelMode') ) {
 else {
     my $key =
       RT::Interface::Web::SquishedCSS( Name => $style )->Key;
-    $style_path = "$style/main-squished-$key.css";
+    $style_path = "$style-squished-$key.css";
 }
 
 </%INIT>
diff --git a/share/html/NoAuth/css/dhandler b/share/html/NoAuth/css/dhandler
index af81080..5239392 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{(.*)-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
diff --git a/t/web/squish.t b/t/web/squish.t
index 8de1c69..23ca0ee 100644
--- a/t/web/squish.t
+++ b/t/web/squish.t
@@ -13,7 +13,7 @@ diag "test squished files with devel mode disabled";
     ( $url, $m ) = RT::Test->started_ok;
     $m->login;
 
-    $m->follow_link_ok( { url_regex => qr!main-squished-([a-f0-9]{32})\.css! },
+    $m->follow_link_ok( { url_regex => qr!aileron-squished-([a-f0-9]{32})\.css! },
         'follow squished css' );
     $m->content_like( qr!/\*\* End of .*?.css \*/!, 'squished css' );
     $m->content_lacks( 'text-decoration: underline !important;',
@@ -40,7 +40,7 @@ SKIP:
     ( $url, $m ) = RT::Test->started_ok;
 
     $m->login;
-    $m->follow_link_ok( { url_regex => qr!main-squished-([a-f0-9]{32})\.css! },
+    $m->follow_link_ok( { url_regex => qr!aileron-squished-([a-f0-9]{32})\.css! },
         'follow squished css' );
     $m->content_like( qr!/\*\* End of .*?.css \*/!, 'squished css' );
     $m->content_contains( 'text-decoration: underline !important;',

commit a5e4e3867164e0d7e38a4bbc824987a4ce981de0
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Dec 23 13:38:32 2010 +0800

    it's enought to let RT::Interface::Squished(CSS|JS) only accept one name parameter

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 5d12400..5f6fef4 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -70,33 +70,31 @@ use RT::Interface::Web::Session;
 use Digest::MD5 ();
 use Encode qw();
 
-=head2 SquishedCSS Name => $name, Files => [...]
+=head2 SquishedCSS $name
 
 =cut
 
 my %SQUISHED_CSS;
 sub SquishedCSS {
-    my %args = @_;
-    my $name = $args{Name} or die "need Name";
+    my $name = shift or die "need name";
     return $SQUISHED_CSS{$name} if $SQUISHED_CSS{$name};
     require RT::Squish::CSS;
-    my $css = RT::Squish::CSS->new(%args);
+    my $css = RT::Squish::CSS->new( Name => $name );
     $SQUISHED_CSS{ $css->Name } = $css;
     return $css;
 }
 
-=head2 SquishedJS Name => $name, Files => [...]
+=head2 SquishedJS $name
 
 =cut
 
 my %SQUISHED_JS;
 sub SquishedJS {
-    my %args = @_;
-    my $name = $args{Name} or die "need Name";
+    my $name = shift or die "need Name";
     return $SQUISHED_JS{$name} if $SQUISHED_JS{$name};
 
     require RT::Squish::JS;
-    my $js = RT::Squish::JS->new(%args);
+    my $js = RT::Squish::JS->new( Name => $name );
     $SQUISHED_JS{ $js->Name } = $js;
     return $js;
 }
diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index 196c82d..32aa46a 100755
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -110,7 +110,7 @@ if ( RT->Config->Get('DevelMode') ) {
 }
 else {
     my $key =
-      RT::Interface::Web::SquishedCSS( Name => $style )->Key;
+      RT::Interface::Web::SquishedCSS( $style )->Key;
     $style_path = "$style-squished-$key.css";
 }
 
diff --git a/share/html/Elements/HeaderJavascript b/share/html/Elements/HeaderJavascript
index 2734f0e..ffeea1a 100644
--- a/share/html/Elements/HeaderJavascript
+++ b/share/html/Elements/HeaderJavascript
@@ -80,7 +80,7 @@ $onload => undef
 my $js_path;
 if ( !RT->Config->Get('DevelMode') ) {
     my $name = 'head';
-    my $key = RT::Interface::Web::SquishedJS( Name => $name )->Key;
+    my $key = RT::Interface::Web::SquishedJS( $name )->Key;
     $js_path = "$name-squished-$key.js";
 }
 
diff --git a/share/html/NoAuth/css/dhandler b/share/html/NoAuth/css/dhandler
index 5239392..83b6ce8 100644
--- a/share/html/NoAuth/css/dhandler
+++ b/share/html/NoAuth/css/dhandler
@@ -52,7 +52,7 @@ my $squisher;
 my $arg = $m->dhandler_arg;
 if ( $arg =~ m{(.*)-squished-[0-9a-f]{32}\.css$} ) {
     my $name = $1;
-    my $squished = RT::Interface::Web::SquishedCSS( Name => $name );
+    my $squished = RT::Interface::Web::SquishedCSS( $name );
     # Don't send Last-Modified since we don't handle If-Modified-Since
     #$r->header_out( 'Last-Modified'  => $squished->ModifiedTimeString );
     $m->out( $squished->Content );
diff --git a/share/html/NoAuth/js/dhandler b/share/html/NoAuth/js/dhandler
index b83786c..a4caeda 100644
--- a/share/html/NoAuth/js/dhandler
+++ b/share/html/NoAuth/js/dhandler
@@ -53,7 +53,7 @@ my $content = '';
 my $arg = $m->dhandler_arg;
 if ( $arg =~ m{(.+?)-squished-[a-f0-9]{32}\.js$} ) {
     my $name = $1;
-    my $squished = RT::Interface::Web::SquishedJS( Name => $name );
+    my $squished = RT::Interface::Web::SquishedJS( $name );
 
     # Don't send Last-Modified since we don't handle If-Modified-Since
     #$r->header_out( 'Last-Modified'  => $squished->ModifiedTimeString );

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


More information about the Rt-commit mailing list