Skip to content

Instantly share code, notes, and snippets.

@johnbintz
Created November 29, 2010 18:24
Show Gist options
  • Save johnbintz/720323 to your computer and use it in GitHub Desktop.
Save johnbintz/720323 to your computer and use it in GitHub Desktop.
Watchr script to do things that I want it to do
def growl(title, message)
system %{growlnotify -m "#{message}" "#{title}"}
end
def reek(file)
output = %x{reek #{file}}
puts output
file, warnings = output.split("\n").first.split(" -- ")
growl "REEK: #{file}", warnings
end
def yard
system %{yard doc {app,lib}/**/*.rb}
end
watch('(app|lib)/(.*)\.rb') { |match|
reek(match[0])
yard
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment