Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 83f44241c089
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: adfd1b3d2e69
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Nov 10, 2017

  1. Copy the full SHA
    1a4f888 View commit details
  2. Copy the full SHA
    adfd1b3 View commit details
Showing with 12 additions and 10 deletions.
  1. +12 −10 bin/jruby.bash
22 changes: 12 additions & 10 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -180,6 +180,10 @@ fi
# ----- Execute The Requested Command -----------------------------------------
JAVA_ENCODING=""

if [ -e "/dev/urandom" ]; then
JAVA_SECURITY_EGD="/dev/urandom"
fi

declare -a java_args
declare -a ruby_args
mode=""
@@ -219,21 +223,13 @@ do
CP="$CP$CP_DELIMITER$2"
CLASSPATH=""
shift
elif [ "${val:0:3}" = "-G:" ]; then # Graal options
opt=${val:3}
case $opt in
+*)
opt="${opt:1}=true" ;;
-*)
opt="${opt:1}=false" ;;
esac
echo "$1 is deprecated - use -J-Dgraal.$opt instead" >&2
java_args=("${java_args[@]}" "-Dgraal.$opt")
else
if [ "${val:0:3}" = "-ea" ]; then
VERIFY_JRUBY="yes"
elif [ "${val:0:16}" = "-Dfile.encoding=" ]; then
JAVA_ENCODING=$val
elif [ "${val:0:20}" = "-Djava.security.egd=" ]; then
JAVA_SECURITY_EGD=$val
fi
java_args=("${java_args[@]}" "${1:2}")
fi
@@ -315,6 +311,12 @@ if [[ $darwin && -z "$JAVA_ENCODING" ]]; then
java_args=("${java_args[@]}" "-Dfile.encoding=UTF-8")
fi

# Force OpenJDK-based JVMs to use /dev/urandom for random number generation
# See https://github.com/jruby/jruby/issues/4685 among others.
if [[ -n "$JAVA_SECURITY_EGD" ]]; then
java_args=("${java_args[@]}" "-Djava.security.egd=$JAVA_SECURITY_EGD")
fi

# Append the rest of the arguments
ruby_args=("${ruby_args[@]}" "$@")