Skip to content

Instantly share code, notes, and snippets.

@jpsirois
Last active October 11, 2015 04:07
Show Gist options
  • Save jpsirois/5f2038e66326ea73e4c1 to your computer and use it in GitHub Desktop.
Save jpsirois/5f2038e66326ea73e4c1 to your computer and use it in GitHub Desktop.
Guardfile Exemple
guard 'shell' do
watch(/(^src\/haml\/(.+)\.haml)/) do |match|
puts match[0] + " changed at " + Time.now.strftime("%H:%M:%S") +". Re-generating HTML from HAML"
`haml #{match[1]} #{match[2]}.html`
`terminal-notifier -group 'haml' -title 'Regenerating Coffeescript' -message '#{match[0]}'`
end
watch(/(^src\/sass\/.+)/) do |match|
puts match[0] + " changed at " + Time.now.strftime("%H:%M:%S") +". Re-generating CSS from SASS."
`Compass compile`
`terminal-notifier -group 'compass' -title 'Regenerating Compass' -message '#{match[0]}'`
end
watch(/(^src\/coffeescript\/.+)/) do |match|
puts match[0] + " changed at " + Time.now.strftime("%H:%M:%S") +". Re-generating JS from CoffeeScript"
`coffee -c -o assets/javascripts src/coffeescript`
`terminal-notifier -group 'coffeescript' -title 'Regenerating Coffeescript' -message '#{match[0]}'`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment