Last Updated: February 25, 2016
·
882
· mixandgo

git hook to regenerate ctags

The nice thing about this solution is it indexes all the gems and the ruby version.

#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
trap "rm -f .git/tags.$$" EXIT
ctags --tag-relative -Rf.git/tags.$$ --exclude=.git --exclude=*.html --exclude=tmp --exclude=public --exclude=app/assets --languages=-javascript,sql,html $MY_RUBY_HOME `bundle show --paths`
mv .git/tags.$$ .git/tags