Browse code

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.

Andrew Hodges authored on 28/05/2011 at 14:16:06
Showing 1 changed files
... ...
@@ -1,3 +1,28 @@
1 1
 fpath=($ZSH/plugins/rvm $fpath)
2 2
 autoload -U compinit
3 3
 compinit -i
4
+
5
+local ruby18='ruby-1.8.7-p334'
6
+local ruby19='ruby-1.9.2-p180'
7
+
8
+function rb18 {
9
+	if [ -z "$1" ]; then
10
+		rvm use "$ruby18"
11
+	else
12
+		rvm use "$ruby18@$1"
13
+	fi
14
+}
15
+
16
+_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`}
17
+compdef _rb18 rb18
18
+
19
+function rb19 {
20
+	if [ -z "$1" ]; then
21
+		rvm use "$ruby19"
22
+	else
23
+		rvm use "$ruby19@$1"
24
+	fi
25
+}
26
+
27
+_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`}
28
+compdef _rb19 rb19