|
|
@ -1,6 +1,7 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/sh |
|
|
|
# |
|
|
|
# |
|
|
|
# 2012 Evax Software <contact@evax.fr> |
|
|
|
# 2012 Evax Software <contact@evax.fr> |
|
|
|
|
|
|
|
# 2012 Nico Schottelius (nico-cdist at schottelius.org) |
|
|
|
# |
|
|
|
# |
|
|
|
# This file is part of cdist. |
|
|
|
# This file is part of cdist. |
|
|
|
# |
|
|
|
# |
|
|
@ -25,29 +26,27 @@ state_is="$(cat "$__object/explorer/state")" |
|
|
|
user="$(cat "$__object/parameter/user")" |
|
|
|
user="$(cat "$__object/parameter/user")" |
|
|
|
default="$(cat "$__object/parameter/default" 2>/dev/null || true)" |
|
|
|
default="$(cat "$__object/parameter/default" 2>/dev/null || true)" |
|
|
|
state_should="$(cat "$__object/parameter/state")" |
|
|
|
state_should="$(cat "$__object/parameter/state")" |
|
|
|
if [ "$state_is" != "$state_should" ]; then |
|
|
|
|
|
|
|
case "$state_should" in |
|
|
|
[ "$state_is" = "$state_should" ] && exit 0 |
|
|
|
present) |
|
|
|
|
|
|
|
cat << DONE |
|
|
|
case "$state_should" in |
|
|
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
present) |
|
|
|
rvm $gemset --create" |
|
|
|
cat << DONE |
|
|
|
|
|
|
|
su - "$user" -c "source ~/.rvm/scripts/rvm; rvm $gemset --create" |
|
|
|
DONE |
|
|
|
DONE |
|
|
|
case "$default" in |
|
|
|
case "$default" in |
|
|
|
no) |
|
|
|
no) |
|
|
|
;; |
|
|
|
;; |
|
|
|
*) |
|
|
|
*) |
|
|
|
cat << DONE |
|
|
|
cat << DONE |
|
|
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
su - "$user" -c "source ~/.rvm/scripts/rvm; rvm use --default $gemset" |
|
|
|
rvm use --default $gemset" |
|
|
|
|
|
|
|
DONE |
|
|
|
DONE |
|
|
|
;; |
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
;; |
|
|
|
;; |
|
|
|
absent) |
|
|
|
absent) |
|
|
|
cat << DONE |
|
|
|
cat << DONE |
|
|
|
su - "$user" -c "source \"\\\$HOME/.rvm/scripts/rvm\" |
|
|
|
su - "$user" -c "source ~/.rvm/scripts/rvm; rvm use $ruby; rvm --force gemset delete $gemsetname" |
|
|
|
rvm use $ruby; rvm --force gemset delete $gemsetname" |
|
|
|
|
|
|
|
DONE |
|
|
|
DONE |
|
|
|
;; |
|
|
|
;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
fi |
|
|
|
|
|
|
|