|
|
|
@ -23,12 +23,13 @@ ruby="$(echo "$gemset" | cut -d '@' -f 1)" |
|
|
|
|
gemsetname="$(echo "$gemset" | cut -d '@' -f 2)" |
|
|
|
|
state_is="$(cat "$__object/explorer/state")" |
|
|
|
|
user="$(cat "$__object/parameter/user")" |
|
|
|
|
default="$(cat "$__object/parameter/default")" |
|
|
|
|
state_should="$(cat "$__object/parameter/state")" |
|
|
|
|
if [ "$state_is" != "$state_should" ]; then |
|
|
|
|
case "$state_should" in |
|
|
|
|
installed) |
|
|
|
|
cat << DONE |
|
|
|
|
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
|
rvm $gemset --create" |
|
|
|
|
DONE |
|
|
|
|
case "$default" in |
|
|
|
@ -36,7 +37,7 @@ DONE |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
cat << DONE |
|
|
|
|
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
|
rvm use --default $gemset" |
|
|
|
|
DONE |
|
|
|
|
;; |
|
|
|
@ -44,7 +45,7 @@ DONE |
|
|
|
|
;; |
|
|
|
|
removed) |
|
|
|
|
cat << DONE |
|
|
|
|
su - $user -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
|
rvm use $ruby; rvm --force gemset delete $gemsetname" |
|
|
|
|
DONE |
|
|
|
|
;; |
|
|
|
|