ruby

package
v0.15.10 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// RubyVersion is the version of Ruby to search for within the wolfi
	// directory. Used to search for packages importing ruby-${RubyVersion}
	RubyVersion string

	// RubyUpdateVersion is the version of Ruby to update to
	RubyUpdateVersion string

	// Path is the path to the wolfi directory or a single package to check
	Path string

	// Client is the client used to communicate with Github
	Client *http2.RLHTTPClient

	// NoCache instructs the client to not use cached results
	NoCache bool
}

func (*Options) CheckUpgrade

func (o *Options) CheckUpgrade(ctx context.Context, pkg *Package) error

CheckUpgrade attempts to find a gemspec for a given ruby gem and tries to extract the required_ruby_version field from it. The required_ruby_version should provide a set of constraints restricting the version of ruby a gem can run on. CheckUpgrade simply tries to make sure the given RubyUpdateVersion is within those constraints.

func (*Options) CodeSearch

func (o *Options) CodeSearch(ctx context.Context, pkg *Package, query string) error

CodeSearch is the main search function which uses Github Code Search to run the specified query for a particular package.

func (*Options) DiscoverRubyPackages

func (o *Options) DiscoverRubyPackages(ctx context.Context) ([]Package, error)

DiscoverRubyPackages searches a given path for melange yaml files using packages named ruby-${RubyVersion}. It takes a path to a directory or an individual file. A list of RubyPackages will be returned to the caller.

type Package

type Package struct {
	// Name is the name of the package, package.name in the melange yaml
	Name string

	// Repo is a URL struct representing the git repo for a ruby package
	Repo *wgit.URL

	// Ref is the version of the ruby package, used to query github
	Ref string
}

type SearchResult

type SearchResult struct {
	Repository string
	FilePath   string
	URL        string
	Fragments  []string
}

SearchResult represents Github Code Search results

Jump to

Keyboard shortcuts

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