Permalink
Browse files

ruby: automatically add gem's bins into path

  • Loading branch information...
1 parent 9196d02 commit ee85b7ca69b1aefa0479d8b177cd07f3d87108e9 @shurizzle shurizzle committed Dec 8, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 ruby/init.zsh
View
@@ -33,4 +33,17 @@ if zdefault -t ':zoppo:plugin:ruby:rbenv' enable 'no'; then
fi
# }}}
+function {
+ local GPATH
+ typeset -ga path
+
+ if (( $+commands[ruby] )); then
+ ruby -rubygems -e 'puts Gem.path' | \
+ while read GPATH; do
+ path+=("$GPATH/bin")
+ done
+ path=($^path(N-/))
+ fi
+}
+
# vim: ft=zsh sts=2 ts=2 sw=2 et fdm=marker fmr={{{,}}}

0 comments on commit ee85b7c

Please sign in to comment.