public FoundLibrary findLibrary(String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { FoundLibrary library = findBuiltinLibrary(baseName, suffix); if (library == null) library = findResourceLibrary(baseName, suffix); if (library != null) { return library; } } return findServiceLibrary(baseName); }
protected Library findLibraryBySearchState(SearchState state) { if (librarySearcher.findBySearchState(state) != null) { // findBySearchState should fill the state already return state.library; } return null; }
private FoundLibrary findFileResource(String searchName, String suffix) { return findFileResourceWithLoadPath(searchName, suffix, null); }
private FoundLibrary findResourceLibrary(String baseName, String suffix) { if (baseName.startsWith("./")) { return findFileResource(baseName, suffix); return findFileResource(baseName, suffix); String path = home + "/" + baseName.substring(2); return findFileResource(path, suffix); if (isAbsolute(baseName)) { return findFileResource(baseName, suffix); FoundLibrary library = findFileResourceWithLoadPath(baseName, suffix, getPath(loadPathEntry)); if (library != null) return library; FoundLibrary library = findFileResourceWithLoadPath(baseName, suffix, "."); return findFileResourceWithLoadPath(baseName, suffix, URLResource.URI_CLASSLOADER);
public LoadService(Ruby runtime) { this.runtime = runtime; if (RubyInstanceConfig.DEBUG_LOAD_TIMINGS) { loadTimer = new TracingLoadTimer(); } else { loadTimer = new LoadTimer(); } this.librarySearcher = new LibrarySearcher(this); }
public FoundLibrary findBySearchState(LoadService.SearchState state) { FoundLibrary lib = findLibrary(state.searchFile, state.suffixType); if (lib != null) { state.library = lib; state.setLoadName(lib.getLoadName()); } return lib; }
private FoundLibrary findResourceLibrary(String baseName, String suffix) { if (baseName.startsWith("./")) { return findFileResource(baseName, suffix); return findFileResource(baseName, suffix); String path = home + "/" + baseName.substring(2); return findFileResource(path, suffix); if (isAbsolute(baseName)) { return findFileResource(baseName, suffix); FoundLibrary library = findFileResourceWithLoadPath(baseName, suffix, getPath(loadPathEntry)); if (library != null) return library; FoundLibrary library = findFileResourceWithLoadPath(baseName, suffix, "."); return findFileResourceWithLoadPath(baseName, suffix, URLResource.URI_CLASSLOADER);
public LoadService(Ruby runtime) { this.runtime = runtime; if (RubyInstanceConfig.DEBUG_LOAD_TIMINGS) { loadTimer = new TracingLoadTimer(); } else { loadTimer = new LoadTimer(); } this.librarySearcher = new LibrarySearcher(this); }
public FoundLibrary findBySearchState(LoadService.SearchState state) { FoundLibrary lib = findLibrary(state.searchFile, state.suffixType); if (lib != null) { state.library = lib; state.setLoadName(lib.getLoadName()); } return lib; }
public FoundLibrary findLibrary(String baseName, SuffixType suffixType) { for (String suffix : suffixType.getSuffixes()) { FoundLibrary library = findBuiltinLibrary(baseName, suffix); if (library == null) library = findResourceLibrary(baseName, suffix); if (library != null) { return library; } } return findServiceLibrary(baseName); }
protected Library findLibraryBySearchState(SearchState state) { if (librarySearcher.findBySearchState(state) != null) { // findBySearchState should fill the state already return state.library; } return null; }
private FoundLibrary findFileResource(String searchName, String suffix) { return findFileResourceWithLoadPath(searchName, suffix, null); }