3e433165502a01028fcd0368161a2193eaeb386c
- Author
- Andrew Hodges <betawaffle@gmail.com>
- Committer
- Andrew Hodges <betawaffle@gmail.com>
- Date
Message
Ruby Switching Helpers
Add helper functions to switch gemsets on ruby-1.8.7-p334 and ruby-1.9.2-p180.
Add completion definitions for helper functions.
Diff
1diff --git a/plugins/rvm/rvm.plugin.zsh b/plugins/rvm/rvm.plugin.zsh
2index ef934d547a903728e2f91e255601b11db267f70d..27412383693baae52d3eacfaaed9ded6afc2a93e 100644
3--- a/plugins/rvm/rvm.plugin.zsh
4+++ b/plugins/rvm/rvm.plugin.zsh
5@@ -1,3 +1,28 @@
6 fpath=($ZSH/plugins/rvm $fpath)
7 autoload -U compinit
8 compinit -i
9+
10+local ruby18='ruby-1.8.7-p334'
11+local ruby19='ruby-1.9.2-p180'
12+
13+function rb18 {
14+ if [ -z "$1" ]; then
15+ rvm use "$ruby18"
16+ else
17+ rvm use "$ruby18@$1"
18+ fi
19+}
20+
21+_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`}
22+compdef _rb18 rb18
23+
24+function rb19 {
25+ if [ -z "$1" ]; then
26+ rvm use "$ruby19"
27+ else
28+ rvm use "$ruby19@$1"
29+ fi
30+}
31+
32+_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`}
33+compdef _rb19 rb19