mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 08:39:24 +01:00
do not use actual path for packagePath from compress case
This commit is contained in:
@@ -103,8 +103,21 @@ public class RubyBundlerAnalyzer extends RubyGemspecAnalyzer {
|
|||||||
|
|
||||||
if(matchingFiles.length > 0) {
|
if(matchingFiles.length > 0) {
|
||||||
String gemPath = matchingFiles[0].getAbsolutePath();
|
String gemPath = matchingFiles[0].getAbsolutePath();
|
||||||
if(gemPath != null)
|
if(dependency.getActualFilePath().equals(dependency.getFilePath())) {
|
||||||
dependency.setPackagePath(gemPath);
|
if(gemPath != null)
|
||||||
|
dependency.setPackagePath(gemPath);
|
||||||
|
} else {
|
||||||
|
//.gemspec's actualFilePath and filePath are different when it's from a compressed file
|
||||||
|
//in which case actualFilePath is the temp directory used by decompression.
|
||||||
|
//packagePath should use the filePath of the identified gem file in "gems" folder
|
||||||
|
File gemspecStub = new File(dependency.getFilePath());
|
||||||
|
File specDir = gemspecStub.getParentFile();
|
||||||
|
if(specDir != null && specDir.getName().equals(SPECIFICATIONS)) {
|
||||||
|
File gemsDir2 = new File(specDir.getParentFile(), GEMS);
|
||||||
|
File packageDir = new File(gemsDir2, gemName);
|
||||||
|
dependency.setPackagePath(packageDir.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user