Permalink
Browse files

better jruby.home detection on IBM WAS

Signed-off-by: Hiro Asari <asari.ruby@gmail.com>
  • Loading branch information...
1 parent 43e91dd commit bec227e1034c2ffab41034bff06b49ff805a15b5 @kares kares committed with BanzaiMan Feb 9, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/org/jruby/embed/util/SystemPropertyCatcher.java
@@ -209,7 +209,11 @@ public static String findJRubyHome(Object instance) {
public static String findFromJar(Object instance) {
URL resource = instance.getClass().getResource("/META-INF/jruby.home");
if (resource == null) {
- return null;
+ // on IBM WebSphere getResource for a dir returns null but an actual
+ // file if it's there returns e.g. wsjar:file:/opt/IBM/WebSphere/...
+ // .../jruby-stdlib-1.6.7.dev.jar!/META-INF/jruby.home/bin/jrubyc
+ resource = instance.getClass().getResource("/META-INF/jruby.home/bin/jrubyc");
+ if (resource == null) return null;
}
String location = null;

0 comments on commit bec227e

Please sign in to comment.