Skip to content

Instantly share code, notes, and snippets.

@jbrown
Created January 28, 2011 01:53
Show Gist options
  • Save jbrown/799675 to your computer and use it in GitHub Desktop.
Save jbrown/799675 to your computer and use it in GitHub Desktop.
.git/hooks/pre-commit
#!/usr/bin/env ruby
# Check Ruby syntax and run the test suites
exit 1 unless
system('git diff --cached --name-only | grep "\(Rakefile\|\.rb$\)" | xargs ruby -c') &&
system('rake ci')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment