ruby

package
v1.5.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package ruby contains components for interrogating ruby packages in container layers.

Index

Constants

This section is empty.

Variables

View Source
var (
	Repository = claircore.Repository{
		Name: repository,
		URI:  "https://rubygems.org/gems/",
	}
)

Functions

func NewCoalescer

func NewCoalescer(_ context.Context) (indexer.Coalescer, error)

func NewEcosystem

func NewEcosystem(_ context.Context) *indexer.Ecosystem

NewEcosystem provides the set of scanners for the ruby ecosystem.

Types

type Matcher added in v1.5.7

type Matcher struct{}

Matcher attempts to correlate discovered ruby packages with reported vulnerabilities.

func (*Matcher) Filter added in v1.5.7

func (*Matcher) Filter(record *claircore.IndexRecord) bool

Filter implements driver.Matcher.

func (*Matcher) Name added in v1.5.7

func (*Matcher) Name() string

Name implements driver.Matcher.

func (*Matcher) Query added in v1.5.7

func (*Matcher) Query() []driver.MatchConstraint

Query implements driver.Matcher.

func (*Matcher) Vulnerable added in v1.5.7

func (*Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)

Vulnerable implements driver.Matcher.

type Scanner

type Scanner struct{}

Scanner implements the scanner.PackageScanner interface.

It looks for files that seem like gems, and looks at the metadata recorded there. This type attempts to follow the specs documented here: https://guides.rubygems.org/specification-reference/.

The zero value is ready to use.

func (Scanner) DefaultRepository added in v1.5.21

func (Scanner) DefaultRepository(ctx context.Context) *claircore.Repository

DefaultRepository implements indexer.DefaultRepoScanner.

func (*Scanner) Kind

func (*Scanner) Kind() string

Kind implements scanner.VersionedScanner.

func (*Scanner) Name

func (*Scanner) Name() string

Name implements scanner.VersionedScanner.

func (*Scanner) Scan

func (ps *Scanner) Scan(ctx context.Context, layer *claircore.Layer) ([]*claircore.Package, error)

Scan attempts to find gems and record the package information there.

A return of (nil, nil) is expected if there's nothing found.

func (*Scanner) Version

func (*Scanner) Version() string

Version implements scanner.VersionedScanner.

type Segment added in v1.5.21

type Segment interface {
	Compare(other Segment) int
}

Segment is a part of a RubyGem version.

type Version added in v1.5.21

type Version struct {
	// contains filtered or unexported fields
}

Version is a RubyGem version. This is based on the official implementation.

func NewVersion added in v1.5.21

func NewVersion(version string) (Version, error)

NewVersion creates a Version out of the given string.

func (Version) Compare added in v1.5.21

func (v Version) Compare(other Version) int

Compare returns an integer comparing this version, v, to other. The result will be 0 if v == other, -1 if v < other, and +1 if v > other.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL