example/example_helper.rb in asir_xml-1.1.11 vs example/example_helper.rb in asir_xml-1.1.12
- old
+ new
@@ -37,15 +37,16 @@
Process.exit!(0)
# dont do client, client is our parent process.
else
$stderr.puts " spawning at #{__FILE__}:#{__LINE__}"
ENV['ASIR_JRUBY_SPAWNED'] = "1"
- cmd = "ruby -I #{File.dirname(__FILE__)} -I #{File.expand_path('../../lib', __FILE__)} #{$0} #{ARGV * ' '}"
- $stderr.puts " cmd = #{cmd}"
- $server_pid = Spoon.spawnp(cmd)
+ cmd = [ RUBY_INTERPRETER_PATH, "-I", "#{File.dirname(__FILE__)}", "-I", "#{File.expand_path('../../lib', __FILE__)}", "#{$0}", *ARGV ]
+ $stderr.puts " cmd = #{cmd * ' '}"
+ $server_pid = Spoon.spawnp(*cmd)
ENV.delete('ASIR_JRUBY_SPAWNED')
$stderr.puts " spawned #{$server_pid} at #{__FILE__}:#{__LINE__}"
+ sleep 10
end
else
# $stderr.puts " at #{__FILE__}:#{__LINE__}"
$server_pid = Process.fork do
puts "*** #{$$}: server process"; $stdout.flush
@@ -64,9 +65,14 @@
rescue Errno::ESRCH
ensure
$server_pid = nil
end
+require 'rbconfig'
+RUBY_INTERPRETER_PATH = File.join(RbConfig::CONFIG["bindir"],
+ RbConfig::CONFIG["RUBY_INSTALL_NAME"] +
+ RbConfig::CONFIG["EXEEXT"])
end
+
puts "*** #{$$}: client process"; $stdout.flush