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: 0b02dae0b66a^
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b4ed904e3cb6
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 16, 2015

  1. Copy the full SHA
    0b02dae View commit details
  2. Copy the full SHA
    a08b412 View commit details
  3. Copy the full SHA
    b4ed904 View commit details
13 changes: 7 additions & 6 deletions core/src/main/java/org/jruby/runtime/load/LibrarySearcher.java
Original file line number Diff line number Diff line change
@@ -133,6 +133,12 @@ private FoundLibrary findResourceLibrary(String baseName, String suffix) {
return findFileResource(baseName, suffix);
}

baseName = baseName.replace("classpath:", "");
// formally obey the fact that the current directory is NOT implicitly on the LOAD_PATH
if (! new File(baseName).exists()) {
FoundLibrary library = findFileResourceWithLoadPath(baseName, suffix, URLResource.URI_CLASSLOADER);
if (library != null) return library;
}
try {
for (IRubyObject loadPathEntry : loadService.loadPath.toJavaArray()) {
FoundLibrary library = findFileResourceWithLoadPath(baseName, suffix, getPath(loadPathEntry));
@@ -263,12 +269,7 @@ private void loadClass(Ruby runtime, InputStream is, boolean wrap) {
private void loadJar(Ruby runtime, boolean wrap) {
try {
URL url;
if (location.startsWith(ClasspathResource.CLASSPATH)){
// get URL directly from the classloader with its StreamHandler set
// by the classloader itself
url = ClasspathResource.getResourceURL(location);
}
else if (location.startsWith(URLResource.URI)){
if (location.startsWith(URLResource.URI)){
url = null;
runtime.getJRubyClassLoader().addURLNoIndex(URLResource.getResourceURL(runtime, location));
}
149 changes: 0 additions & 149 deletions core/src/main/java/org/jruby/util/ClasspathResource.java

This file was deleted.

4 changes: 1 addition & 3 deletions core/src/main/java/org/jruby/util/JRubyFile.java
Original file line number Diff line number Diff line change
@@ -81,10 +81,8 @@ public static FileResource createResource(POSIX posix, Ruby runtime, String cwd,
if (jarResource != null) return jarResource;

if (pathname.contains(":")) { // scheme-oriented resources
if (pathname.startsWith("classpath:")) return ClasspathResource.create(pathname);

// replace is needed for maven/jruby-complete/src/it/app_using_classpath_uri to work
if (pathname.startsWith("uri:")) return URLResource.create(runtime, pathname.replace("classpath:/", ""));
if (pathname.startsWith("uri:")) return URLResource.create(runtime, pathname);

if (pathname.startsWith("file:")) {
pathname = pathname.substring(5);
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
import java.util.Arrays;
import java.io.File;
import java.io.StringWriter;
import java.net.URL;
import java.net.URLClassLoader;

import org.jruby.embed.LocalContextScope;
import org.jruby.embed.ScriptingContainer;
@@ -69,7 +71,7 @@ private void runIt(String index) throws Exception {
private void runIt(String index, String script) throws Exception {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
//Thread.currentThread().setContextClassLoader();
Thread.currentThread().setContextClassLoader(new URLClassLoader( new URL[] {}, null ));
System.err.println("\n\nrunning --------- " + index + "\n");
ScriptingContainer container = newScriptingContainer();
if (script != null) container.runScriptlet( script );