summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <hans@degraaff.org>2009-04-05 21:45:10 +0200
committerHans de Graaff <hans@degraaff.org>2009-04-05 21:45:10 +0200
commit42a85b05ae9eeff897bdcc2c5394a06ae4b0bee9 (patch)
tree4b312d950ffb6dd15467319da57fd498d1e47ffb /eselect-rails
parentFix old copy-paste leftovers. (diff)
downloadruby-scripts-42a85b05ae9eeff897bdcc2c5394a06ae4b0bee9.tar.gz
ruby-scripts-42a85b05ae9eeff897bdcc2c5394a06ae4b0bee9.tar.bz2
ruby-scripts-42a85b05ae9eeff897bdcc2c5394a06ae4b0bee9.zip
Use RAILS variable consistently.
Diffstat (limited to 'eselect-rails')
-rw-r--r--eselect-rails/rails.eselect14
1 files changed, 7 insertions, 7 deletions
diff --git a/eselect-rails/rails.eselect b/eselect-rails/rails.eselect
index 9fed96b..e120345 100644
--- a/eselect-rails/rails.eselect
+++ b/eselect-rails/rails.eselect
@@ -32,7 +32,7 @@ remove_symlink() {
# determine the version
get_version() {
- local basename="$(basename $(canonicalise ${ROOT}/usr/bin/rails ) )"
+ local basename="$(basename $(canonicalise ${RAILS} ) )"
local version=${basename#*-}
echo ${version}
}
@@ -80,9 +80,9 @@ do_show() {
fi
write_list_start "Current Ruby on Rails version:"
- if [[ -L "${ROOT}/usr/bin/rails" ]] ; then
- write_kv_list_entry "$(basename $(canonicalise ${ROOT}/usr/bin/rails ) )" ""
- elif [[ -e "${ROOT}/usr/bin/rails" ]] ; then
+ if [[ -L "${RAILS}" ]] ; then
+ write_kv_list_entry "$(basename $(canonicalise ${RAILS} ) )" ""
+ elif [[ -e "${RAILS}" ]] ; then
write_kv_list_entry "(not a symlink)" ""
else
write_kv_list_entry "(unset)" ""
@@ -137,14 +137,14 @@ do_set() {
local version=${1}
if [[ -z ${version} ]] ; then
die -q "You didn't give me a version name"
- elif [[ -L "${ROOT}/usr/bin/rails" ]] ; then
+ elif [[ -L "${RAILS}" ]] ; then
if ! remove_symlink ; then
die -q "Can't remove existing rails binary"
elif ! set_symlink "${1}" ; then
die -q "Can't set new rails binary"
fi
- elif [[ -e "${ROOT}/usr/bin/rails" ]] ; then
- write_warning_msg "Can't set a new rails provider. There's a file in the way at ${ROOT}/usr/bin/rails. You can try removing it manually, and then re-running this command."
+ elif [[ -e "${RAILS}" ]] ; then
+ write_warning_msg "Can't set a new rails provider. There's a file in the way at ${RAILS}. You can try removing it manually, and then re-running this command."
else
set_symlink ${version} || die -q "Wasn't able to set a new provider"
fi