Created
September 24, 2011 14:04
-
-
Save albertoleal/1239360 to your computer and use it in GitHub Desktop.
WatchrValidation
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
watch('^app/assets/stylesheets/(.*\.scss)') { |m| WatchrValidation.check_sass(m[1]) } | |
class WatchrValidation | |
@@image_root = "~/Development/autotest_images" | |
def self.check_sass(sass_file) | |
result = system("clear; sass --check app/assets/stylesheets/#{sass_file}") | |
image = if result | |
"#{@@image_root}/pass.png" | |
else | |
"#{@@image_root}/fail.png" | |
end | |
growl_it "Sass Validation", result, image, 5 | |
end | |
def self.growl_it title, msg, img="", pri=0, sticky="" | |
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment