Skip to content

Commit

Permalink
Unbreak the classpath: ScriptingContainer change.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 5, 2014
1 parent 43051c5 commit 5a4bcb2
Showing 1 changed file with 9 additions and 6 deletions.
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5a4bcb2

Please sign in to comment.