44#
55# Environment Variable Prequisites
66#
7- # JRUBY_BASE (Optional) Base directory for resolving dynamic portions
8- # of a JRuby installation. If not present, resolves to
9- # the same directory that JRUBY_HOME points to.
10- #
11- # JRUBY_HOME (Optional) May point at your JRuby "build" directory.
12- # If not present, the current working directory is assumed.
13- #
147# JRUBY_OPTS (Optional) Default JRuby command line args
158# JRUBY_SHELL Where/What is system shell
169#
2720
2821# ----- Verify and Set Required Environment Variables -------------------------
2922
30- if [ -z " $JRUBY_HOME " ] ; then
31- # # resolve links - $0 may be a link to home
32- PRG=$0
33- progname=` basename " $0 " `
34-
35- while [ -h " $PRG " ] ; do
36- ls=` ls -ld " $PRG " `
37- link=` expr " $ls " : ' .*-> \(.*\)$' `
38- if expr " $link " : ' .*/.*' > /dev/null; then
39- PRG=" $link "
40- else
41- PRG=" ` dirname $PRG ` /$link "
42- fi
43- done
44-
45- JRUBY_HOME_1=` dirname " $PRG " ` # the ./bin dir
46- JRUBY_HOME_1=` dirname " $JRUBY_HOME_1 " ` # the . dir
47- if [ -d " ${JRUBY_HOME_1} /lib" ] ; then
48- JRUBY_HOME=" ${JRUBY_HOME_1} "
49- fi
50- else
51- if $cygwin ; then
52- JRUBY_HOME=` cygpath -u " $JRUBY_HOME " `
23+ # # resolve links - $0 may be a link to home
24+ PRG=$0
25+ progname=` basename " $0 " `
26+
27+ while [ -h " $PRG " ] ; do
28+ ls=` ls -ld " $PRG " `
29+ link=` expr " $ls " : ' .*-> \(.*\)$' `
30+ if expr " $link " : ' .*/.*' > /dev/null; then
31+ PRG=" $link "
32+ else
33+ PRG=" ` dirname $PRG ` /$link "
5334 fi
54- fi
35+ done
36+
37+ JRUBY_HOME_1=` dirname " $PRG " ` # the ./bin dir
38+ JRUBY_HOME=` dirname " $JRUBY_HOME_1 " ` # the . dir
5539
5640if [ -z " $JRUBY_OPTS " ] ; then
5741 JRUBY_OPTS=" "
9983 fi
10084fi
10185
102- # ----- Set Up JRUBY_BASE If Necessary -------------------------------------
103-
104- if [ -z " $JRUBY_BASE " ] ; then
105- JRUBY_BASE=" $JRUBY_HOME "
106- fi
107-
10886# ----- Execute The Requested Command -----------------------------------------
10987
110-
11188JAVA_MEM=-Xmx378m
11289JAVA_STACK=-Xss1024k
11390
@@ -153,7 +130,6 @@ JAVA_OPTS="$JAVA_OPTS ${java_args[@]} $JAVA_MEM $JAVA_STACK"
153130
154131if $cygwin ; then
155132 JAVA_HOME=` cygpath --mixed " $JAVA_HOME " `
156- JRUBY_BASE=` cygpath --mixed " $JRUBY_BASE " `
157133 JRUBY_HOME=` cygpath --mixed " $JRUBY_HOME " `
158134 JRUBY_SHELL=` cygpath --mixed " $JRUBY_SHELL " `
159135
@@ -165,9 +141,8 @@ if $cygwin; then
165141 fi
166142fi
167143
168- exec " $JAVA_CMD " $JAVA_OPTS -classpath " $CP " \
169- " -Djruby.base= $JRUBY_BASE " " -Djruby. home=$JRUBY_HOME " \
170- " -Djruby.lib=$JRUBY_BASE /lib" -Djruby.script=jruby \
171- " -Djruby.shell=$JRUBY_SHELL " \
144+ exec " $JAVA_CMD " $JAVA_OPTS -classpath " $CP " \
145+ " -Djruby.home=$JRUBY_HOME " \
146+ " -Djruby.lib=$JRUBY_HOME /lib" -Djruby.script=jruby \
147+ " -Djruby.shell=$JRUBY_SHELL " \
172148 org.jruby.Main $JRUBY_OPTS " $@ "
173-
0 commit comments