Forum: JRuby access JRuby options

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bf512c651c47ac6421e41f93dc19c726?d=identicon&s=25 Josh Moore (Guest)
on 2009-03-11 06:55
(Received via mailing list)
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
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-03-12 18:05
(Received via mailing list)
Josh Moore 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
This topic is locked and can not be replied to.