github.com/noqcks/syft@v0.0.0-20230920222752-a9e2c4e288e5/syft/pkg/cataloger/common/cpe/ruby.go (about)

     1  package cpe
     2  
     3  import "github.com/anchore/syft/syft/pkg"
     4  
     5  func candidateVendorsForRuby(p pkg.Package) fieldCandidateSet {
     6  	metadata, ok := p.Metadata.(pkg.GemMetadata)
     7  	if !ok {
     8  		return nil
     9  	}
    10  
    11  	vendors := newFieldCandidateSet()
    12  
    13  	for _, author := range metadata.Authors {
    14  		// author could be a name or an email
    15  		vendors.add(fieldCandidate{
    16  			value:                 normalizePersonName(stripEmailSuffix(author)),
    17  			disallowSubSelections: true,
    18  		})
    19  	}
    20  
    21  	if metadata.Homepage != "" {
    22  		vendors.union(candidateVendorsFromURL(metadata.Homepage))
    23  	}
    24  
    25  	return vendors
    26  }