ruby

package
v0.38.18 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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