Skip to content

Instantly share code, notes, and snippets.

@pcalcado
Created April 26, 2012 15:14
Show Gist options
  • Save pcalcado/2500286 to your computer and use it in GitHub Desktop.
Save pcalcado/2500286 to your computer and use it in GitHub Desktop.
pre checkin for legacy/slow rails apps
#!/bin/bash
function specs_to_run(){
git status | grep rb$ | awk '{print $3}' | sed -e "s/^[a-z][a-z]*/spec/g" | sed -e "s/[a-z_]*.rb$/\*/g" | sort | uniq
}
echo "Need to run these before checking-in:"
specs_to_run
bundle exec spec `specs_to_run | xargs -L 1000 echo`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment