Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/main/java/org/jruby/runtime/load/LoadService.java
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
***** END LICENSE BLOCK *****/
package org.jruby.runtime.load;

import org.jruby.util.FileResource;
import org.jruby.util.collections.StringArraySet;
import java.io.File;
import java.io.FileDescriptor;
@@ -321,8 +322,13 @@ public void load(String file, boolean wrap) {

Library library = findLibraryBySearchState(state);

// load() will do a last chance look in current working directory for the file (see load.c:rb_f_load()).
if (library == null) {
throw runtime.newLoadError("no such file to load -- " + file, file);
FileResource fileResource = JRubyFile.createResourceAsFile(runtime, file);

if (!fileResource.exists()) throw runtime.newLoadError("no such file to load -- " + file, file);

library = LibrarySearcher.ResourceLibrary.create(file, file, fileResource);
}

try {

0 comments on commit 2366376

Please sign in to comment.