Skip to content

Commit 3fb2bfc

Browse files
committed
Revert "Set the mtime of pre-cached assets to the newest mtime of the files being packaged."
This reverts commit ef54119.
1 parent 7c02fc1 commit 3fb2bfc

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

lib/jammit/packager.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ def initialize
3838
# changed since their last package build.
3939
def precache_all(output_dir=nil, base_url=nil)
4040
output_dir ||= File.join(PUBLIC_ROOT, Jammit.package_path)
41-
cacheable(:js, output_dir).each {|p| cache(p, 'js', pack_javascripts(p), output_dir, nil, newest_mtime(p, :js)) }
41+
cacheable(:js, output_dir).each {|p| cache(p, 'js', pack_javascripts(p), output_dir) }
4242
cacheable(:css, output_dir).each do |p|
43-
mtime = newest_mtime(p, :css)
44-
cache(p, 'css', pack_stylesheets(p), output_dir, nil, mtime)
43+
cache(p, 'css', pack_stylesheets(p), output_dir)
4544
if Jammit.embed_assets
46-
cache(p, 'css', pack_stylesheets(p, :datauri), output_dir, :datauri, mtime)
45+
cache(p, 'css', pack_stylesheets(p, :datauri), output_dir, :datauri)
4746
if Jammit.mhtml_enabled && base_url
47+
mtime = Time.now
4848
asset_url = "#{base_url}#{Jammit.asset_url(p, :css, :mhtml, mtime)}"
4949
cache(p, 'css', pack_stylesheets(p, :mhtml, asset_url), output_dir, :mhtml, mtime)
5050
end
@@ -73,11 +73,6 @@ def individual_urls(package, extension)
7373
package_for(package, extension)[:urls]
7474
end
7575

76-
# Return the modification time of the newest file in the package
77-
def newest_mtime(package, extension)
78-
package_for(package, extension)[:paths].map { |path| File.mtime(path) }.max
79-
end
80-
8176
# Return the compressed contents of a stylesheet package.
8277
def pack_stylesheets(package, variant=nil, asset_url=nil)
8378
@compressor.compress_css(package_for(package, :css)[:paths], variant, asset_url)

0 commit comments

Comments
 (0)