Skip to content
Permalink
Browse files
asd
  • Loading branch information
mkristian committed Dec 6, 2014
1 parent d51d452 commit 3cb192706f18a582927931c2bf17f2613875b040
Showing with 4 additions and 3 deletions.
  1. +4 −3 core/src/main/java/org/jruby/util/URLResource.java
@@ -149,8 +149,9 @@ public ChannelDescriptor openDescriptor(ModeFlags flags, int perm) throws Resour
}

public static FileResource createClassloaderURI(Ruby runtime, String pathname) {
// retrieve the classloader from the runtime if available otherwise mimic how the runtime got its classloader
ClassLoader cl = runtime != null ? runtime.getJRubyClassLoader().getParent() : URLResource.class.getClassLoader();
// retrieve the classloader from the runtime if available otherwise mimic how the runtime got its classloader and
// take this
ClassLoader cl = runtime != null ? runtime.getJRubyClassLoader() : URLResource.class.getClassLoader();
if (cl == null ) {
cl = Thread.currentThread().getContextClassLoader();
}
@@ -300,7 +301,7 @@ private static String[] listFiles(String pathname) {
public static URL getResourceURL(Ruby runtime, String location)
{
if (location.startsWith(URI + CLASSLOADER)){
return runtime.getJRubyClassLoader().getParent().getResource(location.substring(URI_CLASSLOADER.length()));
return runtime.getJRubyClassLoader().getResource(location.substring(URI_CLASSLOADER.length()));
}
try
{

0 comments on commit 3cb1927

Please sign in to comment.