Skip to content
Permalink
Browse files
Unbreak the classpath: ScriptingContainer change.
  • Loading branch information
headius committed Dec 5, 2014
1 parent 43051c5 commit 5a4bcb2dc6d793e115a1855d19647cc4dbea9d8b
Showing with 9 additions and 6 deletions.
  1. +9 −6 core/src/main/java/org/jruby/embed/internal/EmbedRubyRuntimeAdapterImpl.java
@@ -129,12 +129,15 @@ public EmbedEvalUnit parse(PathType type, String filename, int... lines) {
break;
case CLASSPATH:
URL loc = container.getProvider().getRuntime().getJRubyClassLoader().getResource(filename);
filename = LoadService.classpathFilenameFromURL(filename, loc, true);
try {
istream = loc.openStream();
} catch (IOException ioe) {
// should not happen
throw new ParseFailedException(ioe);
if (loc == null) {
istream = null; // as in ClassLoader.getResourceAsStream
} else {
filename = LoadService.classpathFilenameFromURL(filename, loc, true);
try {
istream = loc.openStream();
} catch (IOException ioe) {
istream = null; // as in getClassLoader.getResourceAsStream
}
}
break;
}

0 comments on commit 5a4bcb2

Please sign in to comment.