Created
June 16, 2011 21:11
-
-
Save tizoc/1030286 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task :watch_assets => [:compile_css, :compile_js] do |t, args| | |
| timeout = ENV['WATCH_ASSETS_TIMEOUT'] || '0.2' | |
| lockdir = './assets.lock' | |
| cmd = <<-EOS | |
| if mkdir #{lockdir} &>/dev/null; then | |
| sleep #{timeout} | |
| rake -s compile_css | |
| rake -s compile_js | |
| rmdir #{lockdir} | |
| fi | |
| EOS | |
| system(%Q{watchmedo shell-command --patterns="*.js;*.scss" --command='#{cmd}' app/views/css/ public/js}) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment