2010-04-22 4 views
3

J'ai écrit une recette Capistrano pour supprimer le fichier JavaScript en cache all.js et dire au serveur de redémarrer, mais cela ne fonctionne toujours pas correctement. Et inévitablement je dois aller supprimer manuellement le fichier all.js, puis redémarrer manuellement Apache. (toucher restart.txt ne fonctionne pas toujours).Mise en cache JavaScript, Rails et Apache passager?

Quelqu'un at-il une solution de travail à ce problème?

Voici la recette actuelle:

desc "Package Javascripts" 
    task :package_javascripts, :roles => :web do 
     sudo %{rm -f #{current_path}/public/javascripts/all.js} 
     javascripts.each do |javascript| 
     run %{/usr/bin/ruby #{current_path}/lib/jsmin.rb < \ 
       #{current_path}/public/javascripts/#{javascript}.js >> \ 
       #{current_path}/public/javascripts/all.js} 
     end 
     run "touch #{current_path}/tmp/restart.txt" 
    end 

Répondre

0

Avez-vous quelque part étroitement liés vous la tâche:

after "deploy:symlink", :package_javascripts 

changer également la ligne de redémarrage:

run "rm -f #{current_path}/tmp/restart.txt ; touch #{current_path}/tmp/restart.txt" 
Questions connexes