How to tell if profiling is enabled

I want to profile some code but only when the built in profiler is
enabled
e.g. “–profile”.

At the moment I am interrogating the global runtime like so:

Java::OrgJRuby::Ruby.global_runtime.instance_config.profiling_mode !=

Java::OrgJruby::RubyInstanceConfig::ProfilingMode::OFF

Is there a simple way to know if the profiler is enabled?

Thanks,
Ariel V.
e-mail: [email protected]
website: http://blog.arielvalentin.com
skype: ariel.s.valentin
twitter: arielvalentin
linkedin: Sign Up | LinkedIn