From 0e780e990bad30b0af0764b16833f35a1b89d72c Mon Sep 17 00:00:00 2001 From: kennyj Date: Fri, 13 Jan 2012 02:46:40 +0900 Subject: Fix GH #3980. Support assets:cache:clean method to respect sprockets cache. --- actionpack/lib/sprockets/assets.rake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/sprockets') diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index 43405f3db9..f3547359cd 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -62,11 +62,11 @@ namespace :assets do ruby_rake_task("assets:precompile:nondigest", false) if Rails.application.config.assets.digest end - task :primary => ["assets:environment", "tmp:cache:clear"] do + task :primary => ["assets:cache:clean"] do internal_precompile end - task :nondigest => ["assets:environment", "tmp:cache:clear"] do + task :nondigest => ["assets:cache:clean"] do internal_precompile(false) end end @@ -77,13 +77,19 @@ namespace :assets do end namespace :clean do - task :all => ["assets:environment", "tmp:cache:clear"] do + task :all => ["assets:cache:clean"] do config = Rails.application.config public_asset_path = File.join(Rails.public_path, config.assets.prefix) rm_rf public_asset_path, :secure => true end end + namespace :cache do + task :clean => ["assets:environment"] do + Rails.application.assets.cache.clear + end + end + task :environment do if Rails.application.config.assets.initialize_on_precompile Rake::Task["environment"].invoke -- cgit v1.2.3