Permalink
Browse files

call Kernel.require ruby method from autoload callback instead of cal…

…ling internal require
  • Loading branch information...
1 parent 26e08ba commit 22b7aa40ba861282712fbf8f98976fda37747152 @ashanbrown committed Sep 4, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/org/jruby/RubyKernel.java
@@ -195,9 +195,10 @@ public String file() {
}
public void load(Ruby runtime) {
- if (runtime.getLoadService().lockAndRequire(file())) {
- // Do not finish autoloading by cyclic autoload
- module.finishAutoload(baseName);
+ final ThreadContext context = runtime.getCurrentContext();
+ if (runtime.getKernel().callMethod(context, "require", file).isTrue()) {
+ // Do not finish autoloading by cyclic autoload
+ module.finishAutoload(baseName);
}
}
});

0 comments on commit 22b7aa4

Please sign in to comment.