Skip to content

Instantly share code, notes, and snippets.

@jkogara
Created May 2, 2014 14:17
Show Gist options
  • Save jkogara/cd5cf5c26ca88a54087a to your computer and use it in GitHub Desktop.
Save jkogara/cd5cf5c26ca88a54087a to your computer and use it in GitHub Desktop.
Ctags for project including gems
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
REL_PATH="`dirname \"$0\"`"
RUBY_VERSION=`cat $REL_PATH/../../.ruby-version`
PART_VERSION=`echo $RUBY_VERSION | awk 'BEGIN { FS = "-" } ; { print $1 }'`
GEMDIR=/opt/boxen/rbenv/versions/$RUBY_VERSION/lib/ruby/gems/$PART_VERSION/gems/
trap "rm -f .git/tags.$$" EXIT
ctags --tag-relative -Rf.git/tags.$$ --exclude=.git --languages=-javascript,sql --exclude=log --exclude=angular/node_modules --exclude=*bower_components* --exclude=doc --exclude=nohup.out --exclude=coverage --exclude=prototype --exclude=*coffee-script-source* --exclude=tmp --exclude=features --exclude=spec * $GEMDIR
mv .git/tags.$$ .git/tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment