File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ set _VM_OPTS=
1414set _RUBY_OPTS =
1515set _DFLT_VM_OPTS = %JAVA_OPTS%
1616set _JAVA_VM = -client
17+ set _JAVA_CLASS = org.jruby.Main
18+ set _JRUBY_BOOTCP_OPTS = -Xbootclasspath/a:" %JRUBY_CP% "
1719
1820set SAFE_JAVA_HOME = %JAVA_HOME:( =^^( %
1921set SAFE_JAVA_HOME = %SAFE_JAVA_HOME:) =^^) %
@@ -89,6 +91,24 @@ if ["%_CMP%"] == ["--1.8"] (
8991 goto :jvmarg
9092)
9193
94+ if [" %_CMP% " ] == [" --ng-server" ] (
95+ set _JAVA_CLASS = com.martiansoftware.nailgun.NGServer
96+ set _JAVA_VM = -server
97+ rem Nailgun server fails if -Xbootclasspath is used, so we remove it here.
98+ rem In com.martiansoftware.nailgun.AliasManager's constructor,
99+ rem getResourceAsStream("com/martiansoftware/nailgun/builtins/builtins.properties")
100+ rem returns null, which is not handled, crashing the server. Removing
101+ rem -Xbootclasspath for some reason fixes the getResourceAsStream() call.
102+ set _JRUBY_BOOTCP_OPTS =
103+ goto :vmoptsNext
104+ )
105+
106+ if [" %_CMP% " ] == [" --ng" ] (
107+ set _NAILGUN_CLIENT = true
108+ goto :vmoptsNext
109+ )
110+
111+
92112rem now unescape _D, _S and _Q
93113set _CMP = %_CMP:_D =" %
94114set _CMP = %_CMP:_S =' %
Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ IF EXIST "%~dp0_jrubyvars.bat" (set FULL_PATH=%~dp0) ELSE (set FULL_PATH=%~dp$PA
1313
1414call " %FULL_PATH% _jrubyvars.bat" %*
1515
16- if %JRUBY_BAT_ERROR% == 0 " %_STARTJAVA% " %_VM_OPTS% -Xbootclasspath/a:" %JRUBY_CP% " -classpath " %CP% ;%CLASSPATH% " -Djruby.home=" %JRUBY_HOME% " -Djruby.lib=" %JRUBY_HOME% \lib" -Djruby.shell=" cmd.exe" -Djruby.script=jruby.bat org.jruby.Main %JRUBY_OPTS% %_RUBY_OPTS%
16+ if %JRUBY_BAT_ERROR% == 0 (
17+ if " %_NAILGUN_CLIENT% " == " " (
18+ " %_STARTJAVA% " %_VM_OPTS% %_JRUBY_BOOTCP_OPTS% -classpath " %CP% ;%CLASSPATH% " -Djruby.home=" %JRUBY_HOME% " -Djruby.lib=" %JRUBY_HOME% \lib" -Djruby.shell=" cmd.exe" -Djruby.script=jruby.bat %_JAVA_CLASS% %JRUBY_OPTS% %_RUBY_OPTS%
19+ ) else (
20+ " %JRUBY_HOME% \tool\nailgun\ng.exe" org.jruby.util.NailMain %JRUBY_OPTS% %_RUBY_OPTS%
21+ )
22+ )
1723set E = %ERRORLEVEL%
1824
1925call " %FULL_PATH% _jrubycleanup"
You can’t perform that action at this time.
0 commit comments