protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }
protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }
protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }
protected boolean trySearch(String file, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { String searchName = file + suffix; if (featureAlreadyLoaded(searchName)) { return false; } } return true; }
if (featureAlreadyLoaded(file)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(state.loadName)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(file)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(state.loadName)) { return RequireState.ALREADY_LOADED;
if (featureAlreadyLoaded(file)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(state.loadName)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(file)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(state.loadName)) { return RequireState.ALREADY_LOADED;
private boolean smartLoadInternal(String file) { checkEmptyLoad(file); SearchState state = findFileForLoad(file); if (state == null) { return false; } if (state.library == null) { throw runtime.newLoadError("no such file to load -- " + state.searchFile, state.searchFile); } // check with long name if (featureAlreadyLoaded(state.loadName)) { return false; } boolean loaded = tryLoadingLibraryOrScript(runtime, state); if (loaded) { addLoadedFeature(file, state.loadName); } return loaded; }
private boolean smartLoadInternal(String file) { checkEmptyLoad(file); SearchState state = findFileForLoad(file); if (state == null) { return false; } if (state.library == null) { throw runtime.newLoadError("no such file to load -- " + state.searchFile, state.searchFile); } // check with long name if (featureAlreadyLoaded(state.loadName)) { return false; } boolean loaded = tryLoadingLibraryOrScript(runtime, state); if (loaded) { addLoadedFeature(file, state.loadName); } return loaded; }
private RequireState requireCommon(String requireName, boolean circularRequireWarning) { if (featureAlreadyLoaded(requireName)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(requireName)) { return RequireState.ALREADY_LOADED;
private RequireState requireCommon(String requireName, boolean circularRequireWarning) { if (featureAlreadyLoaded(requireName)) { return RequireState.ALREADY_LOADED; if (featureAlreadyLoaded(requireName)) { return RequireState.ALREADY_LOADED;
@JRubyMethod(name = "autoload?") public static IRubyObject autoload_p(ThreadContext context, IRubyObject self, IRubyObject symbol) { final Ruby runtime = context.runtime; final String name = TypeConverter.checkID(symbol).idString(); RubyModule mod = RubyKernel.getModuleForAutoload(runtime, self); for (/* RubyModule mod = (RubyModule) self */; mod != null; mod = mod.getSuperClass()) { final IRubyObject loadedValue = mod.fetchConstant(name); if ( loadedValue != null && loadedValue != UNDEF ) return context.nil; final RubyString file; if ( mod.isIncluded() ) { file = mod.getNonIncludedClass().getAutoloadFile(name); } else { file = mod.getAutoloadFile(name); } if ( file != null ) { // due explicit requires still need to : if ( runtime.getLoadService().featureAlreadyLoaded(file.asJavaString()) ) { // TODO in which case the auto-load never finish-es ?! return context.nil; } return file; } } return context.nil; } }
@JRubyMethod(name = "autoload?") public static IRubyObject autoload_p(ThreadContext context, IRubyObject self, IRubyObject symbol) { final Ruby runtime = context.runtime; final String name = TypeConverter.checkID(symbol).idString(); RubyModule mod = RubyKernel.getModuleForAutoload(runtime, self); for (/* RubyModule mod = (RubyModule) self */; mod != null; mod = mod.getSuperClass()) { final IRubyObject loadedValue = mod.fetchConstant(name); if ( loadedValue != null && loadedValue != UNDEF ) return context.nil; final RubyString file; if ( mod.isIncluded() ) { file = mod.getNonIncludedClass().getAutoloadFile(name); } else { file = mod.getAutoloadFile(name); } if ( file != null ) { // due explicit requires still need to : if ( runtime.getLoadService().featureAlreadyLoaded(file.asJavaString()) ) { // TODO in which case the auto-load never finish-es ?! return context.nil; } return file; } } return context.nil; } }