Documentation
¶
Overview ¶
Package tundrabrew is the fleet's one typed model of a Homebrew Formula — so no tool hand-edits a `.rb` with sha256 hashes pasted by hand. A Formula is built with functional options, validated, and rendered to a deterministic, byte-stable Ruby `.rb` string.
It is a pure, generic Homebrew primitive: it models any formula (name, URL, per-platform bottle hashes, dependencies, install/test stanzas) and never names or imports any particular project.
Index ¶
- type Bottle
- type Dependency
- type Formula
- type Option
- func WithBottle(p Platform, sha256 string) Option
- func WithDependency(name, typ string) Option
- func WithDescription(d string) Option
- func WithHomepage(h string) Option
- func WithInstall(lines ...string) Option
- func WithLicense(l string) Option
- func WithSHA256(s string) Option
- func WithTest(lines ...string) Option
- func WithURL(u string) Option
- func WithVersion(v string) Option
- type Platform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct {
Name string
Type string // "", "build", "test", "optional", "recommended"
}
Dependency is a formula dependency, optionally scoped (e.g. ":build", ":test").
type Formula ¶
type Formula struct {
// Name is the formula's Ruby class basename (e.g. "akeyless"); it is
// title-cased into the class declaration automatically.
Name string
Description string
Homepage string
// URL is the source tarball / release archive URL.
URL string
// SHA256 is the source archive checksum (distinct from per-platform bottles).
SHA256 string
Version string
License string
Bottles []Bottle
Dependencies []Dependency
// InstallLines are the Ruby statements inside the `def install` block.
InstallLines []string
// TestLines are the Ruby statements inside the `test do` block.
TestLines []string
}
Formula is a typed, options-built Homebrew formula. The zero value is invalid; build it through New.
func New ¶
New builds a Formula from a required name and options. It does not validate; call Validate (or Render, which validates first).
func (*Formula) ClassName ¶
ClassName returns the Ruby class name Homebrew expects (CamelCase of the formula name, with "-" and "_" treated as word separators). E.g. "my-tool" → "MyTool".
type Option ¶
type Option func(*Formula)
Option configures a Formula.
func WithBottle ¶
WithBottle appends a per-platform bottle (a Platform + its SHA-256).
func WithDependency ¶
WithDependency appends a dependency. typ may be "" for a plain runtime dep.
func WithDescription ¶
WithDescription sets the formula description (`desc`).
func WithInstall ¶
WithInstall sets the lines of the `def install` block.