From a8c0702400af54f51b15d9a12bd3686ef08b6973 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 23 Oct 2013 16:18:24 +0200 Subject: [PATCH] feature #2401: Set RUBYLIB environment with vendorized libs --- src/mad/sh/madcommon.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/mad/sh/madcommon.sh b/src/mad/sh/madcommon.sh index 2b171c191c..e1ffbb6060 100644 --- a/src/mad/sh/madcommon.sh +++ b/src/mad/sh/madcommon.sh @@ -72,3 +72,20 @@ export_rc_vars $DEFAULTRC if [ -z "$PRIORITY" ]; then export PRIORITY=19 fi + +# Add ruby vendorized libraries to the path +if [ -z "${ONE_LOCATION}" ]; then + VENDOR=/usr/lib/one/ruby/vendors +else + VENDOR=$ONE_LOCATION/lib/ruby/vendors +fi + +ls $VENDOR/*/lib &> /dev/null +if [ $? = 0 ]; then + if [ -n "$RUBYLIB" ]; then + RUBYLIB="$RUBYLIB:" + fi + + RUBYLIB="${RUBYLIB}$(echo $VENDOR/*/lib | tr ' ' ':')" +fi +