my scripts rely heavily on external programs and scripts. I need to be sure that a program I need to call exists. Manually, I\'d check this using \'which\' in the commandlin
for jruby, any of the solutions that depend on mkmf may not work, as it has a C extension.
for jruby, the following is an easy way to check if something is executable on the path:
main » unix_process = java.lang.Runtime.getRuntime().exec("git status")
=> #
main » unix_process.exitValue()
=> 0
main »
if the executable isn't there, it will raise a runtime error, so you may want to do this in a try/catch block in your actual usage.