Skip to content

Commit

Permalink
Fix classpath: load path entries to properly do a classloader search.
Browse files Browse the repository at this point in the history
Conflicts:

	src/org/jruby/runtime/load/LoadService.java
  • Loading branch information
headius committed Feb 8, 2012
1 parent 93fdfcd commit 4914cfe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/rdoc
@@ -1,4 +1,4 @@
#!/Users/headius/projects/jruby/bin/jruby
#!/usr/bin/env jruby
#
# This file was generated by RubyGems.
#
Expand Down
2 changes: 1 addition & 1 deletion bin/ri
@@ -1,4 +1,4 @@
#!/Users/headius/projects/jruby/bin/jruby
#!/usr/bin/env jruby
#
# This file was generated by RubyGems.
#
Expand Down
7 changes: 7 additions & 0 deletions src/org/jruby/runtime/load/LoadService.java
Expand Up @@ -1061,11 +1061,14 @@ protected LoadServiceResource tryResourceFromLoadPathOrURL(SearchState state, St
}
} else {
boolean looksLikeJarURL = loadPathLooksLikeJarURL(loadPathEntry);
boolean looksLikeClasspathURL = loadPathLooksLikeClasspathURL(loadPathEntry);
for (String suffix : suffixType.getSuffixes()) {
String namePlusSuffix = baseName + suffix;

if (looksLikeJarURL) {
foundResource = tryResourceFromJarURLWithLoadPath(namePlusSuffix, loadPathEntry);
} else if (looksLikeClasspathURL) {
foundResource = findFileInClasspath(loadPathEntry + "/" + namePlusSuffix);
} else {
foundResource = tryResourceFromLoadPath(namePlusSuffix, loadPathEntry);
}
Expand Down Expand Up @@ -1139,6 +1142,10 @@ protected boolean loadPathLooksLikeJarURL(String loadPathEntry) {
return loadPathEntry.startsWith("jar:") || loadPathEntry.endsWith(".jar") || (loadPathEntry.startsWith("file:") && loadPathEntry.indexOf("!/") != -1);
}

protected boolean loadPathLooksLikeClasspathURL(String loadPathEntry) {
return loadPathEntry.startsWith("classpath:");
}

protected LoadServiceResource tryResourceFromLoadPath( String namePlusSuffix,String loadPathEntry) throws RaiseException {
LoadServiceResource foundResource = null;

Expand Down

0 comments on commit 4914cfe

Please sign in to comment.