From ea1f4cba389ec86ea7f7d9ed0463ecaa991d1a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Stepp=C3=A9?= Date: Fri, 12 Dec 2025 16:20:53 +0100 Subject: [PATCH] feat: add support for Gemfile.next.lock (#4457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexandre Steppé --- syft/pkg/cataloger/ruby/cataloger.go | 2 +- syft/pkg/cataloger/ruby/cataloger_test.go | 1 + .../ruby/test-fixtures/glob-paths/src/Gemfile.next.lock | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 syft/pkg/cataloger/ruby/test-fixtures/glob-paths/src/Gemfile.next.lock diff --git a/syft/pkg/cataloger/ruby/cataloger.go b/syft/pkg/cataloger/ruby/cataloger.go index 8186278ea..215792050 100644 --- a/syft/pkg/cataloger/ruby/cataloger.go +++ b/syft/pkg/cataloger/ruby/cataloger.go @@ -11,7 +11,7 @@ import ( // NewGemFileLockCataloger returns a new Bundler cataloger object tailored for parsing index-oriented files (e.g. Gemfile.lock). func NewGemFileLockCataloger() pkg.Cataloger { return generic.NewCataloger("ruby-gemfile-cataloger"). - WithParserByGlobs(parseGemFileLockEntries, "**/Gemfile.lock") + WithParserByGlobs(parseGemFileLockEntries, "**/Gemfile.lock", "**/Gemfile.next.lock") } // NewInstalledGemSpecCataloger returns a new Bundler cataloger object tailored for detecting installations of gems (e.g. Gemspec). diff --git a/syft/pkg/cataloger/ruby/cataloger_test.go b/syft/pkg/cataloger/ruby/cataloger_test.go index 3d79c7a93..92a364ae7 100644 --- a/syft/pkg/cataloger/ruby/cataloger_test.go +++ b/syft/pkg/cataloger/ruby/cataloger_test.go @@ -17,6 +17,7 @@ func Test_GemFileLock_Globs(t *testing.T) { fixture: "test-fixtures/glob-paths", expected: []string{ "src/Gemfile.lock", + "src/Gemfile.next.lock", }, }, } diff --git a/syft/pkg/cataloger/ruby/test-fixtures/glob-paths/src/Gemfile.next.lock b/syft/pkg/cataloger/ruby/test-fixtures/glob-paths/src/Gemfile.next.lock new file mode 100644 index 000000000..5ffba7b57 --- /dev/null +++ b/syft/pkg/cataloger/ruby/test-fixtures/glob-paths/src/Gemfile.next.lock @@ -0,0 +1 @@ +bogus