Skip to content

Instantly share code, notes, and snippets.

@albertoleal
Created September 24, 2011 14:04
Show Gist options
  • Save albertoleal/1239360 to your computer and use it in GitHub Desktop.
Save albertoleal/1239360 to your computer and use it in GitHub Desktop.
WatchrValidation
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