[Rt-commit] rt branch, squish-refactor, updated. rt-3.9.7-885-ge396fb4

? sunnavy sunnavy at bestpractical.com
Fri Dec 17 09:07:05 EST 2010


The branch, squish-refactor has been updated
       via  e396fb46ea399249a3f6e848ca792d8dfd2c8761 (commit)
       via  6ed672847d837abaf0e04f83af725463c631c21b (commit)
      from  e6b03ead8284f491aa01d7976f46220e0411708f (commit)

Summary of changes:
 lib/RT/Squish.pm               |   11 +++++++----
 share/html/NoAuth/css/dhandler |    3 +--
 share/html/NoAuth/js/dhandler  |    4 ++--
 t/web/squish.t                 |    4 ++--
 4 files changed, 12 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit 6ed672847d837abaf0e04f83af725463c631c21b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 17 21:56:42 2010 +0800

    added ModifiedTimeString accessor to RT::Squish

diff --git a/lib/RT/Squish.pm b/lib/RT/Squish.pm
index ec34c69..4e944b2 100644
--- a/lib/RT/Squish.pm
+++ b/lib/RT/Squish.pm
@@ -72,9 +72,10 @@ use warnings;
 
 package RT::Squish;
 use base 'Class::Accessor::Fast';
-__PACKAGE__->mk_accessors(qw/Files Content Key ModifiedTime Name/);
+__PACKAGE__->mk_accessors(qw/Name Files Content Key ModifiedTime ModifiedTimeString/);
 
 use Digest::MD5 'md5_hex';
+use HTTP::Date;
 
 =head2 new (ARGS)
 
@@ -98,7 +99,7 @@ sub new {
     $self->Content($content);
     $self->Key( md5_hex $content );
     $self->ModifiedTime( time() );
-
+    $self->ModifiedTimeString( HTTP::Date::time2str( $self->ModifiedTime ) );
     return $self;
 }
 
@@ -142,12 +143,14 @@ squished content
 
 md5 of the squished content
 
-=cut
-
 =head2 ModifiedTime
 
 created time of squished content, i.e. seconds since 00:00:00 UTC, January 1, 1970
 
+=head2 ModifiedTimeString
+
+created time of squished content, with HTTP::Date format
+
 =cut
 
 1;
diff --git a/share/html/NoAuth/css/dhandler b/share/html/NoAuth/css/dhandler
index 950b1ac..64050a5 100644
--- a/share/html/NoAuth/css/dhandler
+++ b/share/html/NoAuth/css/dhandler
@@ -53,8 +53,7 @@ my $arg = $m->dhandler_arg;
 if ( $arg =~ m{(.*)/main-squished-(?:[0-9a-f]{32})\.css$} ) {
     my $name = $1;
     my $squished = RT::Interface::Web::SquishedCSS( Name => $name );
-    $r->header_out( 'Last-Modified'  => 
-        HTTP::Date::time2str( $squished->ModifiedTime ) );
+    $r->header_out( 'Last-Modified'  => $squished->ModifiedTimeString );
     $m->out( $squished->Content );
 }
 else {
diff --git a/share/html/NoAuth/js/dhandler b/share/html/NoAuth/js/dhandler
index 3f907c1..d9536ab 100644
--- a/share/html/NoAuth/js/dhandler
+++ b/share/html/NoAuth/js/dhandler
@@ -55,8 +55,8 @@ if ( $arg =~ m{squished-(.+)-([a-z0-9]{32})\.js$} ) {
     my $name = $1;
     my $squished = RT::Interface::Web::SquishedJS( Name => $name );
 
-    $r->header_out( 'Last-Modified'  => 
-        HTTP::Date::time2str( $squished->ModifiedTime ) );
+    require HTTP::Date;
+    $r->header_out( 'Last-Modified'  => $squished->ModifiedTimeString );
 
     $m->out( $squished->Content );
 }

commit e396fb46ea399249a3f6e848ca792d8dfd2c8761
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 17 22:06:37 2010 +0800

    need plack server to test the RT::Squish::->AddFiles()

diff --git a/t/web/squish.t b/t/web/squish.t
index 5fbe139..82c7a7b 100644
--- a/t/web/squish.t
+++ b/t/web/squish.t
@@ -31,8 +31,8 @@ diag "test squished files with devel mode disabled";
 diag "test squished files with customized files and devel mode disabled";
 SKIP:
 {
-    skip 'need actual server to reinitialize', 6
-      if $ENV{RT_TEST_WEB_HANDLER} && $ENV{RT_TEST_WEB_HANDLER} eq 'inline';
+    skip 'need plack server to reinitialize', 6
+      if $ENV{RT_TEST_WEB_HANDLER} && $ENV{RT_TEST_WEB_HANDLER} ne 'plack';
     require RT::Squish::JS;
     RT::Squish::JS->AddFiles( head => ['/NoAuth/js/IE7/IE7.js'] );
     require RT::Squish::CSS;

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


More information about the Rt-commit mailing list