Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kerwin committed Oct 26, 2017
2 parents a80eb05 + f5f0257 commit 41ed1e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1,069 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class GemlockNodeParser {

private boolean inSpecsSection = false
private boolean inDependenciesSection = false
private boolean previousLineWasBundledWith = false;

DependencyGraph parseProjectDependencies(NameVersionNodeTransformer nameVersionNodeTransformer, final List<String> gemfileLockLines) {
rootNameVersionNode = new NameVersionNodeImpl([name: 'gemfileLockRoot'])
Expand All @@ -72,16 +73,19 @@ class GemlockNodeParser {
return
}

if ("BUNDLED WITH".equals(line.trim())){
previousLineWasBundledWith = true;
}else if (previousLineWasBundledWith){
previousLineWasBundledWith = false;
def bundler = nameVersionNodeBuilder.nodeCache["bundler"];
bundler?.version = line.trim();
}

if (!inSpecsSection && !inDependenciesSection) {
return
}

//we are now either in the specs section or in the dependencies section

if (line.trim().equals("bundler")){
return;
}

if (inSpecsSection) {
parseSpecsSectionLine(line)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class HubSignatureScanner {
private Set<String> registeredPathsToExclude = []

public void registerPathToScan(File file, String... fileNamesToExclude) {
if (!detectConfiguration.hubSignatureScannerDisabled) {
boolean scannerEnabled = !detectConfiguration.hubSignatureScannerDisabled;
boolean customPathOverride = detectConfiguration.hubSignatureScannerPaths.size() > 0;

if (scannerEnabled && !customPathOverride) {
String matchingExcludedPath = detectConfiguration.hubSignatureScannerPathsToExclude.find {
file.canonicalPath.startsWith(it)
}
Expand Down Expand Up @@ -102,8 +105,10 @@ class HubSignatureScanner {
} else {
logger.warn("Tried to register a scan for ${file.canonicalPath} but it doesn't appear to exist or it isn't a file or directory.")
}
} else {
logger.info("Not registering path ${file.canonicalPath}, scan is disabled")
} else if (!scannerEnabled) {
logger.info("Not registering path ${file.canonicalPath}, scan is disabled");
}else if (customPathOverride){
logger.info("Not scanning path ${file.canonicalPath}, scan paths provided");
}
}

Expand Down

0 comments on commit 41ed1e7

Please sign in to comment.