github.com/lineaje-labs/syft@v0.98.1-0.20231227153149-9e393f60ff1b/syft/pkg/cataloger/ruby/cataloger.go (about)

     1  /*
     2  Package ruby provides a concrete Cataloger implementation relating to packages within the Ruby language ecosystem.
     3  */
     4  package ruby
     5  
     6  import (
     7  	"github.com/anchore/syft/syft/pkg"
     8  	"github.com/anchore/syft/syft/pkg/cataloger/generic"
     9  )
    10  
    11  // NewGemFileLockCataloger returns a new Bundler cataloger object tailored for parsing index-oriented files (e.g. Gemfile.lock).
    12  func NewGemFileLockCataloger() pkg.Cataloger {
    13  	return generic.NewCataloger("ruby-gemfile-cataloger").
    14  		WithParserByGlobs(parseGemFileLockEntries, "**/Gemfile.lock")
    15  }
    16  
    17  // NewInstalledGemSpecCataloger returns a new Bundler cataloger object tailored for detecting installations of gems (e.g. Gemspec).
    18  func NewInstalledGemSpecCataloger() pkg.Cataloger {
    19  	return generic.NewCataloger("ruby-installed-gemspec-cataloger").
    20  		WithParserByGlobs(parseGemSpecEntries, "**/specifications/**/*.gemspec")
    21  }
    22  
    23  // NewGemSpecCataloger looks for gems without the additional requirement of the gem being installed.
    24  func NewGemSpecCataloger() pkg.Cataloger {
    25  	return generic.NewCataloger("ruby-gemspec-cataloger").
    26  		WithParserByGlobs(parseGemSpecEntries, "**/*.gemspec")
    27  }