use of com.synopsys.integration.bdio.graph.DependencyGraph in project hub-detect by blackducksoftware.
the class GemlockExtractor method extract.
public Extraction extract(final File directory, final File gemlock) {
try {
final List<String> gemlockText = Files.readAllLines(gemlock.toPath(), StandardCharsets.UTF_8);
logger.debug(gemlockText.stream().collect(Collectors.joining("\n")));
final GemlockParser gemlockParser = new GemlockParser(externalIdFactory);
final DependencyGraph dependencyGraph = gemlockParser.parseProjectDependencies(gemlockText);
final ExternalId externalId = externalIdFactory.createPathExternalId(Forge.RUBYGEMS, directory.toString());
final DetectCodeLocation codeLocation = new DetectCodeLocation.Builder(DetectCodeLocationType.RUBYGEMS, directory.toString(), externalId, dependencyGraph).build();
return new Extraction.Builder().success(codeLocation).build();
} catch (final Exception e) {
return new Extraction.Builder().exception(e).build();
}
}
Aggregations