Files
syft/syft/pkg/cataloger/ruby/cataloger.go
T
2025-12-12 10:20:53 -05:00

28 lines
1.1 KiB
Go

/*
Package ruby provides a concrete Cataloger implementation relating to packages within the Ruby language ecosystem.
*/
package ruby
import (
"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/pkg/cataloger/generic"
)
// 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", "**/Gemfile.next.lock")
}
// NewInstalledGemSpecCataloger returns a new Bundler cataloger object tailored for detecting installations of gems (e.g. Gemspec).
func NewInstalledGemSpecCataloger() pkg.Cataloger {
return generic.NewCataloger("ruby-installed-gemspec-cataloger").
WithParserByGlobs(parseGemSpecEntries, "**/specifications/**/*.gemspec")
}
// NewGemSpecCataloger looks for gems without the additional requirement of the gem being installed.
func NewGemSpecCataloger() pkg.Cataloger {
return generic.NewCataloger("ruby-gemspec-cataloger").
WithParserByGlobs(parseGemSpecEntries, "**/*.gemspec")
}