Ouch! Corrected logic mistake in calculation of cache_file freshness

This commit is contained in:
Marcus Mateus 2012-06-12 22:54:15 -05:00
parent 99cef1c9a6
commit 1557bfbc55

View File

@ -214,7 +214,7 @@ module Jasmine::Headless
asset = sprockets_environment.find_asset(file, :bundle => false) asset = sprockets_environment.find_asset(file, :bundle => false)
cache_file = File.join('.jhw-cache', 'code', asset.logical_path) cache_file = File.join('.jhw-cache', 'code', asset.logical_path)
# Process & cache the asset only if needed # Process & cache the asset only if needed
unless File.exist?(cache_file) && (File.mtime(file) > File.mtime(cache_file)) unless File.exist?(cache_file) && (File.mtime(file) < File.mtime(cache_file))
FileUtils.mkdir_p File.dirname(cache_file) FileUtils.mkdir_p File.dirname(cache_file)
asset.write_to(cache_file) asset.write_to(cache_file)
end end