Skip to content

Instantly share code, notes, and snippets.

@slumos
Created January 31, 2009 00:20
Show Gist options
  • Save slumos/55367 to your computer and use it in GitHub Desktop.
Save slumos/55367 to your computer and use it in GitHub Desktop.
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