Skip to content

Commit

Permalink
Revert "Bring back CLEAN_EXPIRED_ASSETS environment variable."
Browse files Browse the repository at this point in the history
This reverts commit 668f13b.
  • Loading branch information
ndbroadbent committed Aug 5, 2014
1 parent d9eceac commit 87df2dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Enjoy your lightning fast deploys!

## Removing Expired Assets

`turbo-sprockets-rails3` provides a Rake task called `assets:clean_expired`. You can run this task after `assets:precompile` to remove outdated assets. To automatically run this `assets:clean_expired` task after `assets:precompile`, you can set the `CLEAN_EXPIRED_ASSETS` environment variable to `true` (`CLEAN_EXPIRED_ASSETS=true rake assets:precompile`).
`turbo-sprockets-rails3` provides a Rake task called `assets:clean_expired`. You can run this task after `assets:precompile` to remove outdated assets.

If you use this rake task, you must set `config.assets.handle_expiration` to true in `config/environments/production.rb`. This makes sure that asset modification times
are updated properly before `assets:precompile`, so that the `clean_expired` task knows which assets are safe to remove.
Expand Down
5 changes: 0 additions & 5 deletions lib/turbo-sprockets/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,3 @@ task_enhancements.each do |task_name, actions|
Rake::Task[task_name].enhance &proc
end
end

# Clean expired assets after asset precompile, if CLEAN_EXPIRED_ASSETS is set
Rake::Task["assets:precompile:all"].enhance do
Rake::Task["assets:clean_expired:all"].invoke if ENV['CLEAN_EXPIRED_ASSETS'].in? %w(true yes 1)
end

0 comments on commit 87df2dc

Please sign in to comment.