Skip to content

Commit

Permalink
warn when jruby home is not set to one of the tested cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mkristian committed Nov 7, 2014
1 parent adcbdc7 commit 2a159b6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/src/main/java/org/jruby/RubyInstanceConfig.java
Expand Up @@ -329,12 +329,21 @@ private String calculateJRubyHome() {

// We require the home directory to be absolute
private static String verifyHome(String home, PrintStream error) {
if (home.equals("uri:classloader:/META-INF/jruby.home" )) {
return home;
}
if (home.equals(".")) {
home = SafePropertyAccessor.getProperty("user.dir");
}
if (home.startsWith("cp:")) {
else if (home.startsWith("cp:")) {
home = home.substring(3);
} else if (!home.startsWith("file:") && !home.startsWith("classpath:") && !home.startsWith("uri:")) {
}
if (home.startsWith("jar:") || ( home.startsWith("file:") && home.contains(".jar!/") ) ||
home.startsWith("classpath:") || home.startsWith("uri:")) {
error.println("Warning: JRuby home with uri like pathes may not have full functionality - use at your own risk");
}
// do not normalize on plain jar like pathes coming from jruby-rack
else if (!home.contains(".jar!/") && !home.startsWith("uri:")) {
NormalizedFile f = new NormalizedFile(home);
if (!f.isAbsolute()) {
home = f.getAbsolutePath();
Expand Down

0 comments on commit 2a159b6

Please sign in to comment.