Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn when jruby home is not set to one of the tested cases
Browse files Browse the repository at this point in the history
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
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 2a159b6

Please sign in to comment.