Skip to content

Commit

Permalink
Ignore remote: prefix in gemfile (CycloneDX#801)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu authored Jan 3, 2024
1 parent f45d15b commit bad8b42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/data/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PATH
remote: test/assets/test-gem

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -395,4 +398,3 @@ RUBY VERSION

BUNDLED WITH
1.17.3

6 changes: 5 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4059,6 +4059,9 @@ export const parseGemfileLockData = async function (gemLockData) {
const tmpA = l.split(" ");
if (tmpA && tmpA.length == 2) {
const name = tmpA[0];
if (name === "remote:") {
return;
}
if (!pkgnames[name]) {
let version = tmpA[1].split(", ")[0];
version = version.replace(/[(>=<)~ ]/g, "");
Expand All @@ -4077,7 +4080,8 @@ export const parseGemfileLockData = async function (gemLockData) {
l === "PLATFORMS" ||
l === "DEPENDENCIES" ||
l === "RUBY VERSION" ||
l === "BUNDLED WITH"
l === "BUNDLED WITH" ||
l === "PATH"
) {
specsFound = false;
}
Expand Down

0 comments on commit bad8b42

Please sign in to comment.