Permalink
Browse files

Use the asset's mtime instead of a constant.

  • Loading branch information...
1 parent 5bca24e commit 09d9794f5e634e2da09b4b107aa7037327f61cd2 @mat813 mat813 committed Apr 26, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/sprockets/asset.rb
  2. +1 −1 lib/sprockets/static_asset.rb
View
@@ -145,7 +145,7 @@ def write_to(filename, options = {})
if options[:compress]
# Run contents through `Zlib`
gz = Zlib::GzipWriter.new(f, Zlib::BEST_COMPRESSION)
- gz.mtime = 1
+ gz.mtime = mtime.to_i
gz.write to_s
gz.close
else
@@ -30,7 +30,7 @@ def write_to(filename, options = {})
pathname.open('rb') do |rd|
File.open("#{filename}+", 'wb') do |wr|
gz = Zlib::GzipWriter.new(wr, Zlib::BEST_COMPRESSION)
- gz.mtime = 1
+ gz.mtime = mtime.to_i
buf = ""
while rd.read(16384, buf)
gz.write(buf)

0 comments on commit 09d9794

Please sign in to comment.