CJX is a Swing application written entirely
in (J)Ruby using the Cheri::Swing and Cheri::Html builders. It enables you to
easily browse classes/modules, configuration/environment
settings, and, if ObjectSpace is enabled, any objects in a
JRuby instance. A small DRb server component can be installed
in other JRuby instances, enabling you to browse them as well.
The CJX client requires JRuby 1.0.3 or later. To run it:
require 'rubygems'
require 'cheri/jruby/explorer'
Cheri::JRuby::Explorer.run
Alternatively, you can load and run it in one step:
require 'rubygems'
require 'cheri/cjx'
This will take several seconds to load and start (performance
is an area of ongoing improvement). Once it loads, it
should be fairly clear what to do.
Performance issues noted in earlier versions have been largely
overcome as of Cheri version 0.5.0.
To install the CJX DRb server component in an instance
(assuming the Cheri gem is installed):
require 'rubygems'
require 'cheri/explorer'
Cheri::Explorer.start nnnn #=> where nnnn is a port
Note that for the server, you require 'cheri/explorer', not 'cheri/jruby/explorer'.
Also note that the
above actually does work in C/MRI Ruby, but due to
the threading implementation (in C/MRI Ruby), requests to
the server then hang in CJX, unless you join the thread:
# C/MRI Ruby only
Cheri::Explorer.thread.join
After that, you can browse just fine in CJX, but you can't do
anything more in the C-Ruby instance, so it's kind of
pointless.