Created
March 5, 2015 22:31
-
-
Save slumos/80b221eb627da0488b38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cdgem { | |
bundle="$(bundle show $1)" | |
gem="$(gem which $1 2>/dev/null | grep '^/')" | |
for gem_dir in "${bundle}" "${gem:h}"; do | |
if [[ -d "${gem_dir}" ]]; then | |
cd "${gem_dir}" | |
return | |
fi | |
done | |
print 'not found' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment