1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Clear out tmp/cache when assets:clean is invoked.

Otherwise, if bad data is cached in tmp/clear then the next invocation
of assets:precompile (or a regular incoming request) will pickup files from
tmp without regenerating them from source.
This commit is contained in:
Ilya Grigorik 2011-08-04 19:17:03 -04:00
parent 04f88d1630
commit 050c1510b6
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ namespace :assets do
end
desc "Remove compiled assets"
task :clean => :environment do
task :clean => [:environment, 'tmp:cache:clear'] do
assets = Rails.application.config.assets
public_asset_path = Rails.public_path + assets.prefix
rm_rf public_asset_path, :secure => true

View file

@ -80,7 +80,7 @@ module ApplicationTests
Dir.chdir(app_path){ `bundle exec rake assets:clean` }
end
files = Dir["#{app_path}/public/assets/**/*"]
files = Dir["#{app_path}/public/assets/**/*", "#{app_path}/tmp/cache/*"]
assert_equal 0, files.length, "Expected no assets, but found #{files.join(', ')}"
end