mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 16:36:40 +01:00
* migrate CPE generation logic to internal Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * remove create function Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
27 lines
576 B
Go
27 lines
576 B
Go
package cpegenerate
|
|
|
|
import "github.com/anchore/syft/syft/pkg"
|
|
|
|
func candidateVendorsForRuby(p pkg.Package) fieldCandidateSet {
|
|
metadata, ok := p.Metadata.(pkg.RubyGemspec)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
|
|
vendors := newFieldCandidateSet()
|
|
|
|
for _, author := range metadata.Authors {
|
|
// author could be a name or an email
|
|
vendors.add(fieldCandidate{
|
|
value: normalizePersonName(stripEmailSuffix(author)),
|
|
disallowSubSelections: true,
|
|
})
|
|
}
|
|
|
|
if metadata.Homepage != "" {
|
|
vendors.union(candidateVendorsFromURL(metadata.Homepage))
|
|
}
|
|
|
|
return vendors
|
|
}
|