File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed
Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 2323 assert_true status . success? , "Process did not exit cleanly"
2424 assert_include output , "Hello World"
2525
26+ output , status = Open3 . capture2 (
27+ "#{ BIN_PATH } --spawn --dev -rwebrick -J-Dsome.prop=foobar -J-Xmx256m -e \" puts 'Hello World'\" " )
28+ assert_true status . success? , "Process did not exit cleanly"
29+ assert_include output , "Hello World"
30+
2631 output , error , status = Open3 . capture3 (
2732 "#{ BIN_PATH } -rwebrick -e 'puts WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd)'" )
2833 assert_true status . success? , "Process did not exit cleanly"
4550 "#{ BIN_PATH } -J-ea -e \" puts 'Hello World'\" " )
4651 assert_true status . success? , "Process did not exit cleanly"
4752 assert_include output , "Hello World"
53+
54+ output , status = Open3 . capture2 (
55+ "#{ BIN_PATH } -S gem install bundler" )
56+ assert_true status . success? , "Process did not exit cleanly"
57+ assert_include output , "1 gem installed"
4858 end
4959 end
5060end
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ def valid?
2626 @valid
2727 end
2828
29+ def spawn?
30+ @spawn == true
31+ end
32+
2933 def java_mem
3034 @java_mem || '-Xmx500m'
3135 end
@@ -109,6 +113,8 @@ def parse(opts)
109113 @java_opts << "-Djruby.compile.invokedynamic=false"
110114 elsif opt == "--sample"
111115 @java_opts << "-Xprof"
116+ elsif opt == "--spawn"
117+ @spawn = true
112118 elsif opt == "--1.8"
113119 puts "warning: --1.8 ignored"
114120 elsif opt == "--1.9"
Original file line number Diff line number Diff line change @@ -69,9 +69,9 @@ def resolve_jruby_classpath
6969 jruby_already_added = true
7070 end
7171 end
72- # FIXME this doesn't work on windows. org/jruby/Main isn't found.
73- # cp_ary << File.join(jruby_home, "lib", "jruby-truffle.jar")
7472 raise "No JRuby JAR found in lib directory!" if cp_ary . empty?
73+ # FIXME this doesn't work on windows. org/jruby/Main isn't found.
74+ #cp_ary << File.join(jruby_home, "lib", "jruby-truffle.jar")
7575 cp_ary . join ( JavaSupport . cp_delim )
7676 end
7777
Original file line number Diff line number Diff line change @@ -30,5 +30,9 @@ def __main__(argv)
3030 "-Djruby.shell=#{ JRubySupport ::SYSTEM_SHELL } " ]
3131
3232 debug "java #{ all_java_opts } #{ java_class } #{ cli_opts . ruby_opts } "
33- JavaSupport . exec_java ( java_class , all_java_opts , cli_opts . ruby_opts )
33+ if cli_opts . spawn?
34+ JavaSupport . system_java ( all_java_opts , java_class , cli_opts . ruby_opts )
35+ else
36+ JavaSupport . exec_java ( java_class , all_java_opts , cli_opts . ruby_opts )
37+ end
3438end
You can’t perform that action at this time.
0 commit comments