private FoundLibrary findBuiltinLibrary(String name, String suffix) { String namePlusSuffix = name + suffix; DebugLog.Builtin.logTry(namePlusSuffix); if (builtinLibraries.containsKey(namePlusSuffix)) { DebugLog.Builtin.logFound(namePlusSuffix); return new FoundLibrary( builtinLibraries.get(namePlusSuffix), namePlusSuffix); } return null; }
private FoundLibrary findBuiltinLibrary(String name, String suffix) { String namePlusSuffix = name + suffix; DebugLog.Builtin.logTry(namePlusSuffix); if (builtinLibraries.containsKey(namePlusSuffix)) { DebugLog.Builtin.logFound(namePlusSuffix); return new FoundLibrary( builtinLibraries.get(namePlusSuffix), namePlusSuffix); } return null; }
private FoundLibrary findServiceLibrary(String name) { DebugLog.JarExtension.logTry(name); Library extensionLibrary = ClassExtensionLibrary.tryFind(runtime, name); if (extensionLibrary != null) { DebugLog.JarExtension.logFound(name); return new FoundLibrary(extensionLibrary, name); } else { return null; } }
private FoundLibrary findServiceLibrary(String name) { DebugLog.JarExtension.logTry(name); Library extensionLibrary = ClassExtensionLibrary.tryFind(runtime, name); if (extensionLibrary != null) { DebugLog.JarExtension.logFound(name); return new FoundLibrary(extensionLibrary, name); } else { return null; } }
private FoundLibrary findFileResourceWithLoadPath(String searchName, String suffix, String loadPath) { String fullPath = loadPath != null ? loadPath + "/" + searchName : searchName; String pathWithSuffix = fullPath + suffix; DebugLog.Resource.logTry(pathWithSuffix); FileResource resource = JRubyFile.createResourceAsFile(runtime, pathWithSuffix); if (resource.exists()) { if (resource.absolutePath() != resource.canonicalPath()) { FileResource expandedResource = JRubyFile.createResourceAsFile(runtime, resource.canonicalPath()); if (expandedResource.exists()){ String scriptName = resolveScriptName(expandedResource, expandedResource.canonicalPath()); String loadName = resolveLoadName(expandedResource, searchName + suffix); return new FoundLibrary(ResourceLibrary.create(searchName, scriptName, resource), loadName); } } DebugLog.Resource.logFound(pathWithSuffix); String scriptName = resolveScriptName(resource, pathWithSuffix); String loadName = resolveLoadName(resource, searchName + suffix); return new FoundLibrary(ResourceLibrary.create(searchName, scriptName, resource), loadName); } return null; }
private FoundLibrary findFileResourceWithLoadPath(String searchName, String suffix, String loadPath) { String fullPath = loadPath != null ? loadPath + "/" + searchName : searchName; String pathWithSuffix = fullPath + suffix; DebugLog.Resource.logTry(pathWithSuffix); FileResource resource = JRubyFile.createResourceAsFile(runtime, pathWithSuffix); if (resource.exists()) { if (resource.absolutePath() != resource.canonicalPath()) { FileResource expandedResource = JRubyFile.createResourceAsFile(runtime, resource.canonicalPath()); if (expandedResource.exists()){ String scriptName = resolveScriptName(expandedResource, expandedResource.canonicalPath()); String loadName = resolveLoadName(expandedResource, searchName + suffix); return new FoundLibrary(ResourceLibrary.create(searchName, scriptName, resource), loadName); } } DebugLog.Resource.logFound(pathWithSuffix); String scriptName = resolveScriptName(resource, pathWithSuffix); String loadName = resolveLoadName(resource, searchName + suffix); return new FoundLibrary(ResourceLibrary.create(searchName, scriptName, resource), loadName); } return null; }