Guest User

Untitled

a guest
Oct 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. require "fileutils"
  2.  
  3. namespace :assets do
  4. namespace :precompile do
  5. desc "Faster way to compile assets"
  6. task fast: ["assets:environment", "tmp:cache:clear", "assets:precompile:primary"] do
  7. config = Rails.application.config
  8. if config.assets.digest
  9. assets_path = File.join(Rails.public_path, config.assets.prefix)
  10. manifest_path = config.assets.manifest || assets_path
  11.  
  12. manifest = YAML.load_file "#{manifest_path}/manifest.yml"
  13. manifest.each do |file, digest_file|
  14. FileUtils.cp "#{assets_path}/#{digest_file}", "#{assets_path}/#{file}"
  15. end
  16. end
  17. end
  18. end
  19. end
Add Comment
Please, Sign In to add comment