aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets
diff options
context:
space:
mode:
authorkennyj <kennyj@gmail.com>2012-01-13 02:46:40 +0900
committerkennyj <kennyj@gmail.com>2012-01-13 02:46:40 +0900
commit0e780e990bad30b0af0764b16833f35a1b89d72c (patch)
tree7f6543d078a49c55e06603c1dd596ecc3deab2e1 /actionpack/lib/sprockets
parente927f06b2528bef52087dd12f012c20ab26fb59c (diff)
downloadrails-0e780e990bad30b0af0764b16833f35a1b89d72c.tar.gz
rails-0e780e990bad30b0af0764b16833f35a1b89d72c.tar.bz2
rails-0e780e990bad30b0af0764b16833f35a1b89d72c.zip
Fix GH #3980. Support assets:cache:clean method to respect sprockets cache.
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r--actionpack/lib/sprockets/assets.rake12
1 files changed, 9 insertions, 3 deletions
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