File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,14 @@ def cannot_compress?(mime_types)
4141 #
4242 # Returns nothing.
4343 def compress ( target )
44+ mtime = PathUtils . stat ( target ) . mtime
4445 PathUtils . atomic_write ( "#{ target } .gz" ) do |f |
4546 gz = Zlib ::GzipWriter . new ( f , Zlib ::BEST_COMPRESSION )
46- gz . mtime = PathUtils . stat ( target ) . mtime
47+ gz . mtime = mtime
4748 gz . write ( @source )
4849 gz . close
50+
51+ File . utime ( mtime , mtime , f . path )
4952 end
5053
5154 nil
Original file line number Diff line number Diff line change @@ -526,7 +526,6 @@ def teardown
526526 original_path = @env [ file_name ] . digest_path
527527 manifest . compile ( file_name )
528528 assert File . exist? ( "#{ @dir } /#{ original_path } .gz" ) , "Expecting '#{ original_path } ' to generate gzipped file: '#{ original_path } .gz' but it did not"
529- assert_equal File . stat ( "#{ @dir } /#{ original_path } " ) . mtime , Zlib ::GzipReader . open ( "#{ @dir } /#{ original_path } .gz" ) { |gz | gz . mtime }
530529 end
531530 end
532531
You can’t perform that action at this time.
0 commit comments