Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 336e527db684
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c31ce4e0e707
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 13, 2014

  1. Copy the full SHA
    5333427 View commit details
  2. Copy the full SHA
    c31ce4e View commit details
Showing with 13 additions and 6 deletions.
  1. +12 −3 core/src/main/java/org/jruby/RubyInstanceConfig.java
  2. +1 −3 core/src/main/java/org/jruby/embed/util/SystemPropertyCatcher.java
15 changes: 12 additions & 3 deletions core/src/main/java/org/jruby/RubyInstanceConfig.java
Original file line number Diff line number Diff line change
@@ -302,7 +302,7 @@ private String calculateJRubyHome() {
newJRubyHome = verifyHome(newJRubyHome, error);
} else {
try {
newJRubyHome = SystemPropertyCatcher.findFromJar(this);
newJRubyHome = SystemPropertyCatcher.findJRubyHome(this);
} catch (Exception e) {}

if (newJRubyHome != null) {
@@ -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();
Original file line number Diff line number Diff line change
@@ -195,10 +195,8 @@ public static String findJRubyHome(Object instance) {
return jrubyhome;
} else if ((jrubyhome = SafePropertyAccessor.getProperty("jruby.home")) != null) {
return jrubyhome;
} else if ((jrubyhome = findFromJar(instance)) != null) {
return jrubyhome;
} else {
return null;
return "uri:classloader:/META-INF/jruby.home";
}
}