Access JRuby options


#1

Hi,

I am working on an ZenTest to make it more JRuby friendly. To do this I
need to active the Objectspace in a sub process (the autotest process
creates it). What I want to be able to do is just pass the options from
the
main process to the sub process. For example if I start ZenTest like
this
jruby -X+O -S autotest. Then within this process is there anyway to
access
the “-X+O” option so that i can pass it into the sub process when I
start
it?

Thanks,

Josh


#2

Josh M. wrote:

Hi,

I am working on an ZenTest to make it more JRuby friendly. To do this I
need to active the Objectspace in a sub process (the autotest process
creates it). What I want to be able to do is just pass the options from
the main process to the sub process. For example if I start ZenTest
like this jruby -X+O -S autotest. Then within this process is there
anyway to access the “-X+O” option so that i can pass it into the sub
process when I start it?

If you require ‘jruby’ there’s a JRuby module you can use for this:

require ‘jruby’

puts JRuby.objectspace
JRuby.objectspace = true
puts JRuby.objectspace
o = Object.new
p o
ObjectSpace.each_object(Object) {|x| p x}

You’ll see that it starts picking up new objects after you set it to
true, and you can query it to pass along to child processes.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email